-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflake.nix
291 lines (253 loc) · 7.38 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
{
description = "Home Manager configuration of nemo157";
inputs = {
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
inputs.home-manager.follows = "home-manager";
};
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
inputs.stable.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:nixos/nixos-hardware/e1c4bac14beb8c409d0534382cf967171706b9d9";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs";
nixur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
jujutsu = {
url = "github:jj-vcs/jj";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.rust-overlay.follows = "rust-overlay";
};
u2f-touch-detector = {
url = "github:Nemo157/u2f-touch-detector/monitor";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.home-manager.follows = "home-manager";
};
appearance-watcher = {
url = "github:Nemo157/appearance-watcher";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
ferris-icons = {
url = "github:Nemo157/ferris-icons";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
# transitive dependencies to allow following :ferrisPensive:
systems.url = "github:nix-systems/default-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = {
self,
agenix,
appearance-watcher,
colmena,
ferris-icons,
home-manager,
jujutsu,
nixos-hardware,
nixpkgs,
nixpkgs-unstable,
nixur,
rust-overlay,
u2f-touch-detector,
...
}: let
system = "x86_64-linux";
pkgs-unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
agenix.overlays.default
colmena.overlays.default
nixur.overlays.default
rust-overlay.overlays.default
jujutsu.overlays.default
u2f-touch-detector.overlays.default
appearance-watcher.overlays.default
ferris-icons.overlays.default
self.overlays.default
];
};
# pin nixpkgs to system nixpkgs for determinism
pin-nixpkgs = {
nix = {
# For flake commands
registry = {
# In case I want to access stuff pre-overlay
nixpkgs.flake = nixpkgs;
# Uses the `legacyPackages` below to allow access to my overlays,
# along with my packages through `packages` like normal
pkgs.flake = self;
};
# For legacy commands
channel.enable = true;
nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
# Don't import all the registry entries, just explicit ones above
settings.flake-registry = "/etc/nixos/registry.json";
};
};
ts = rec {
domain = "emerald-koi.ts.net";
ips = {
contabo = "100.93.46.63";
mithril = "100.120.211.104";
zinc = "100.71.97.27";
};
hosts = pkgs.lib.mapAttrs (host: ip: {
inherit ip;
host = "${host}.${domain}";
}) ips;
};
syncthing = {
Slabish = "OSSG4UZ-FX5FJIW-K4FXLTD-IA5HWNI-TJXV6RT-64JTYCU-IUXET5R-TWZZLAS";
StuffnesslyTri = "AURMWFA-RXS5I5F-KP5QKUB-ZVGDZEY-BTOZEYN-FNOTVDB-LK7PDAE-PVAW6QH";
StuffnesslyZwei = "XCINWZR-MPBT3KM-M5VKVBD-BAN56G2-VZNYE6N-OJJYUKK-2H3WWMP-55LMYQY";
contabo = "FPWUA22-RTUZ7KO-K23E642-EFXWH6P-VSBGMKF-XWLVOO2-LVEHO7M-3VIGKQZ";
mithril = "UAFMSLM-HVNJUCK-JBSKBXZ-TMCCCYR-GUMDNID-IXBXETE-C2SUN6W-KDI4HQN";
zinc = "4OZ4P7V-7PTKETZ-NG4DVX7-5VABDM7-BY2XMW3-2PFOQV7-FRZCABK-VXA4PAT";
};
prefixAttrs = prefix: attrs:
pkgs.lib.mapAttrs'
(name: value: { name = "${prefix}-${name}"; inherit value; })
attrs;
in {
maintainers = {
nemo157 = {
email = "nix@nemo157.com";
name = "Nemo157";
github = "Nemo157";
githubId = 81079;
keys = [{
fingerprint = "E3D8 2B6B F270 2722 4925 CD19 A65D C69A 2364 9F86";
}];
};
};
overlays.default = import ./overlays { inherit pkgs-unstable; inherit (self.outputs) maintainers; };
packages.${system} = import ./packages { inherit pkgs; };
legacyPackages.${system} = pkgs;
devShells.${system} = import ./shells { inherit pkgs; };
colmena = {
meta = {
nixpkgs = pkgs;
specialArgs = {
inherit ts syncthing;
nixos-hardware = nixos-hardware.nixosModules;
};
};
defaults = {
imports = [
agenix.nixosModules.default
home-manager.nixosModules.home-manager
pin-nixpkgs
./nixos/common
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
agenix.homeManagerModules.default
u2f-touch-detector.homeManagerModules.default
./home/scripts.nix
];
};
};
contabo = {
imports = [
./nixos/contabo
];
};
mithril = {
imports = [
./nixos/mithril
];
deployment = {
allowLocalDeployment = true;
buildOnTarget = true;
};
home-manager = {
extraSpecialArgs = {
ts = ts // { self = ts.hosts.mithril; };
};
users.nemo157 = {
imports = [
./home/nemo157.nix
./home/mithril.nix
];
};
};
};
zinc = {
imports = [
./nixos/zinc
];
deployment = {
allowLocalDeployment = true;
};
home-manager = {
extraSpecialArgs = {
ts = ts // { self = ts.hosts.zinc; };
};
users.nemo157 = {
imports = [
./home/nemo157.nix
./home/zinc.nix
];
};
};
};
oak = {
imports = [
./nixos/oak
];
deployment = {
allowLocalDeployment = true;
};
home-manager = {
users.wim = {
imports = [
./home/oak.nix
];
home = { username = "wim"; homeDirectory = "/home/wim"; };
};
};
};
};
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
nixosConfigurations = {
inherit (self.outputs.colmenaHive.nodes) contabo mithril zinc oak;
};
checks.${system} =
(prefixAttrs "packages" self.outputs.packages.${system})
// (prefixAttrs "shells" self.outputs.devShells.${system});
};
}