-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
459 lines (408 loc) · 14.3 KB
/
flake.nix
File metadata and controls
459 lines (408 loc) · 14.3 KB
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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
{
description = "Orual's NixOS and Home-Manager configuration flake, based on Eliza Weisman's";
############################################################################
#### OUTPUTS ###############################################################
outputs = {
self,
nixpkgs,
nixos-hardware,
nixos-raspberrypi,
home,
utils,
rust-overlay,
deploy-rs,
flake-parts,
...
} @ inputs: let
config = {
allowUnfree = true;
input-fonts.acceptLicense = true;
# needed for Obsidian 1.4.16; this version of Electron is EOL but the nixpkgs
# package for Obsidian hasn't been updated to a newer electron yet.
#
# TODO: remove this once https://github.com/NixOS/nixpkgs/issues/263764
# is resolved...
#permittedInsecurePackages = ["electron-26.3.0"];
};
overlays = [
(import ./pkgs/overlay.nix)
rust-overlay.overlays.default
# inputs.atuin.overlays.default
(_: prev: {
claude-desktop =
inputs.claude-desktop.packages.${prev.stdenv.hostPlatform.system}.claude-desktop-with-fhs;
})
(_: prev: {
vesktop = inputs.nixpkgs-stable.legacyPackages.${prev.stdenv.hostPlatform.system}.vesktop;
})
# add alejandra package
(_: prev: {alejandra = inputs.alejandra.defaultPackage.${prev.stdenv.hostPlatform.system};})
# add ghostty package
(_: prev: {ghostty = inputs.ghostty.packages.${prev.stdenv.hostPlatform.system}.ghostty;})
# add ECLSSD
(_: prev: {eclssd = inputs.eclssd.packages.${prev.stdenv.hostPlatform.system}.eclssd;})
# add fw-ectool package
# TODO(orual): it would be nice if this was only added for the framework
# system config...
# (_: prev: { fw-ectool = inputs.fw-ectool.packages.${prev.stdenv.hostPlatform.system}.ectool; })
# add niri overlay
# TODO(orual): similar to the above, would be good to add only for desktop configs
inputs.niri.overlays.niri
(_: prev: {quickshell = inputs.quickshell.packages.${prev.stdenv.hostPlatform.system}.default;})
# (_: prev: {zed-editor = prev.zed-prerelease;})
# add astal package
#inputs.astal-shell.overlays.default
#
# Fix this when unstable gets updated with this patch
(_: prev: {
azure-cli = inputs.nixpkgs-stable.legacyPackages.${prev.stdenv.hostPlatform.system}.azure-cli;
})
(_: prev: {opencode = inputs.opencode.packages.${prev.stdenv.hostPlatform.system}.default;})
(_: prev: {popup-mcp = inputs.popup-mcp.packages.${prev.stdenv.hostPlatform.system}.default;})
];
lib = import ./lib;
in
flake-parts.lib.mkFlake {inherit inputs;} {
perSystem = {
pkgs,
system,
...
}:
with pkgs;
with lib; {
devShells.default = mkShell {
buildInputs = [
deploy-rs.packages.${system}.default
inputs.opnix.packages.${system}.default
alejandra
nix-update
nodejs
curl
jq
git
];
};
packages = {
update-packages = writeShellApplication {
name = "update-packages";
meta = {
description = "update script for custom packages";
};
runtimeInputs = with pkgs; [
alejandra
nix-update
nodejs
curl
jq
git
nix
];
text = ''
${builtins.readFile ./update-packages.sh}
'';
};
};
apps.update-packages = {
type = "app";
program = "${self.packages.${system}.update-packages}/bin/update-packages";
};
};
flake = {
###########
## NixOS ##
###########
nixosConfigurations = lib.genNixOSHosts {
inherit
inputs
config
overlays
self
;
baseModules = [
utils.nixosModules.autoGenFromInputs
self.nixosModules.default
home.nixosModules.home-manager
inputs.eclssd.nixosModules.default
inputs.disko.nixosModules.disko
inputs.stylix.nixosModules.stylix
inputs.nix-monitored.nixosModules.default
inputs.niri.nixosModules.niri
inputs.vscode-server.nixosModules.default
inputs.opnix.nixosModules.default
inputs.tranquil-pds.nixosModules.default
];
};
####################
## NixOS modules ###
####################
nixosModules.default = import ./modules/nixos;
####################
## NixOS (images) ##
####################
# Proxmox VM images (via image.modules.proxmox / system.build.images.proxmox)
proxmoxImages = {
chasmfiend = self.nixosConfigurations.chasmfiend.config.system.build.images.proxmox;
tai-na = self.nixosConfigurations.tai-na.config.system.build.images.proxmox;
saanthid = self.nixosConfigurations.saanthid.config.system.build.images.proxmox;
sja-anat = self.nixosConfigurations.sja-anat.config.system.build.images.proxmox;
};
# images =
# let
# mkPiImage = { hostname, imageKind ? "sd-image-rpi3" }:
# (self.nixosConfigurations.${hostname}.extendModules {
# modules = [
# nixos-raspberrypi.nixosModules.${imageKind}
# ];
# }).config.system.build.sdImage;
# in
# {
# clavius = mkPiImage { hostname = "clavius"; };
# tycho = mkPiImage { hostname = "tycho"; };
# };
#####################
## deploy-rs nodes ##
#####################
deploy.nodes = let
mkNode = {
hostname,
system ? "x86_64-linux",
extraOpts ? {},
}: {
inherit hostname;
profiles.system =
{
sshUser = "orual";
path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${hostname};
user = "root";
}
// extraOpts;
};
in {
chasmfiend = mkNode {
hostname = "chasmfiend";
};
tai-na = mkNode {
hostname = "tai-na";
};
saanthid = mkNode {
hostname = "saanthid";
};
# clavius = mkNode {
# hostname = "clavius";
# system = "aarch64-linux";
# extraOpts = { sshOpts = [ "-t" ]; };
# };
#
# tycho = mkNode {
# hostname = "tycho";
# system = "aarch64-linux";
# extraOpts = { sshOpts = [ "-t" ]; };
# };
pattern = mkNode {hostname = "pattern";};
sja-anat = mkNode {hostname = "sja-anat";};
};
##################
## Home Manager ##
##################
homeConfigurations = lib.genHomeHosts {
inherit inputs config overlays;
user = "orual";
baseModules = [
self.homeModules.default
inputs.zed-extensions.homeManagerModules.default
inputs.zen-browser.homeModules.twilight
inputs.niri.homeModules.niri
inputs.stylix.homeModules.stylix
inputs.noctalia.homeModules.default
];
};
homeModules.default = import ./modules/home;
################
## checks ######
################
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
systems = [
"x86_64-linux"
"aarch64-linux"
];
};
############################################################################
#### NIX CONFIG ############################################################
nixConfig = {
extra-substituters = [
"https://cache.nixos.org"
"https://cache.lix.systems"
"https://nix-community.cachix.org"
"https://cache.garnix.io"
"https://niri.cachix.org"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
};
############################################################################
#### INPUTS ################################################################
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs?ref=nixos-25.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
nixpkgs-azure.url = "github:NixOS/nixpkgs?ref=44272c87af0b641a28dd436b8d962453489bd718";
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
# for building Rust packages
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
opencode = {
url = "github:sst/opencode";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
# deploy-rs: for remote deployments
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
# declarative disk partitioning
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
home = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
noctalia = {
url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
nixos-hardware.url = "github:nixos/nixos-hardware/master";
nixos-raspberrypi = {
url = "github:hawkw/nixos-raspberrypi?ref=eliza/no-noXlibs";
inputs = {
nixpkgs.follows = "nixpkgs";
nixos-hardware.follows = "nixos-hardware";
};
};
utils = {
url = "github:gytis-ivaskevicius/flake-utils-plus/v1.4.0";
inputs.flake-utils.follows = "flake-utils";
};
# for secureboot support on sylpherena
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";
# Optional but recommended to limit the size of your system closure.
inputs = {
nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust-overlay";
flake-parts.follows = "flake-parts";
};
};
# fw ectool as configured for FW13 7040 AMD (until patch is upstreamed)
# fw-ectool = {
# url = "github:tlvince/ectool.nix";
# inputs.nixpkgs.follows = "nixpkgs-stable";
# };
# # depend on the latest `atuin` in order to enable daemon mode
# atuin = {
# url = "github:atuin-sh/atuin/main";
# inputs = {
# nixpkgs.follows = "nixpkgs";
# flake-utils.follows = "flake-utils";
# };
# };
eclssd = {
# url = "github:hawkw/eclssd/6de42a256f547bba72bda5274b3d42dc574676e8";
url = "https://flakehub.com/f/mycoliza/eclssd/0.1.118.tar.gz";
inputs = {
nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust-overlay";
flake-utils.follows = "flake-utils";
};
};
ghostty = {
url = "github:ghostty-org/ghostty";
inputs = {
nixpkgs.follows = "nixpkgs";
# nixpkgs-unstable.follows = "nixpkgs";
# nixpkgs-stable.follows = "nixpkgs-stable";
};
};
# Nix formatter in Rust
alejandra = {
url = "github:kamadorueda/alejandra/3.1.0";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
nix-monitored.url = "github:ners/nix-monitored";
niri.url = "github:sodiboo/niri-flake";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
quickshell = {
# add ?ref=<tag> to track a tag
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
# THIS IS IMPORTANT
# Mismatched system dependencies will lead to crashes and other issues.
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
# IMPORTANT: we're using "libgbm" and is only available in unstable so ensure
# to have it up-to-date or simply don't specify the nixpkgs input
inputs.nixpkgs.follows = "nixpkgs";
};
zed-editor-flake = {
url = "github:HPsaucii/zed-editor-flake";
};
zed-extensions = {
url = "github:DuskSystems/nix-zed-extensions";
};
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
};
claude-desktop.url = "github:k3d3/claude-desktop-linux-flake";
# claude-desktop.inputs.nixpkgs.follows = "nixpkgs";
# claude-desktop.inputs.flake-utils.follows = "flake-utils";
# 1Password secrets management
opnix = {
url = "github:brizzbuzz/opnix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Tranquil PDS (AT Protocol Personal Data Server)
tranquil-pds = {
url = "git+https://tangled.org/tranquil.farm/tranquil-pds";
inputs.nixpkgs.follows = "nixpkgs";
};
# popup-mcp: Native GUI popups via MCP for AI assistants
popup-mcp = {
url = "github:orual/popup-mcp";
inputs = {
nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust-overlay";
flake-utils.follows = "flake-utils";
};
};
};
}