-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
128 lines (105 loc) · 3.78 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nickel.url = "github:tweag/nickel";
nickel.inputs.nixpkgs.follows = "nixpkgs";
/*
The Nix User Repository (NUR) is community-driven meta repository for
Nix packages. It provides access to user repositories that contain package
descriptions (Nix expressions) and allows you to install packages by
referencing them via attributes. In contrast to Nixpkgs, packages are
built from source and are not reviewed by any Nixpkgs member.
*/
nur.url = "github:nix-community/NUR";
neovim-flake.url = "github:neovim/neovim?dir=contrib";
neovim-flake.inputs.nixpkgs.follows = "nixpkgs";
alejandra.url = "github:kamadorueda/alejandra/3.0.0";
alejandra.inputs.nixpkgs.follows = "nixpkgs";
nix-colors.url = "github:misterio77/nix-colors";
flake-utils.url = "github:numtide/flake-utils";
sway-tools.url = "github:smasher164/sway-tools";
sway-tools.flake = true;
sway-tools.inputs.nixpkgs.follows = "nixpkgs";
sway-tools.inputs.flake-utils.follows = "flake-utils";
};
outputs = {
self,
nixpkgs,
nixpkgs-wayland,
home-manager,
nickel,
nur,
neovim-flake,
alejandra,
nix-colors,
flake-utils,
sway-tools,
}: let
system = "x86_64-linux";
overlays = [
nixpkgs-wayland.overlay
(import ./pkgs/neovim/overlay.nix {inherit neovim-flake;})
nur.overlay # adds nur to nixpkgs
];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
inherit (nixpkgs) lib;
in {
# formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
overlays.default = overlays;
packages.${system} = {
inherit (pkgs) neovim neovim-nightly;
};
nixosConfigurations = {
tweag-laptop = lib.nixosSystem {
inherit system;
specialArgs = {inherit nix-colors nickel;};
modules = [
home-manager.nixosModules.home-manager
(import ./system/configuration.nix)
(import ./services/pipewire.nix)
(import ./nix)
({pkgs, ...}: {
environment.systemPackages = with pkgs; [
alejandra.defaultPackage.${system}
neovim
gh
nix-doc
sway-tools.packages.${system}.pw-volume
];
})
({...}: {
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs = {
inherit overlays;
config.allowUnfree = true;
};
# Required since swaylock is installed via home-manager.
security.pam.services.swaylock = {};
# The previous update broke a lot of things. Possibly due to nixpkgs-wayland.
# https://github.com/nix-community/nixpkgs-wayland/issues/346
# Nope it was because of a change in nixpkgs:
# https://github.com/NixOS/nixpkgs/pull/186028
# TODO - disable this if home-manager fixes this
# https://github.com/nix-community/home-manager/issues/3160
security.polkit.enable = true;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.bakerdn = import ./users/bakerdn/home.nix;
home-manager.extraSpecialArgs = {
inherit nix-colors nickel system;
};
})
];
};
};
};
}