Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
652 lines (598 loc) · 26.1 KB
/
Copy pathflake.nix
File metadata and controls
652 lines (598 loc) · 26.1 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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
{
description = "Base configuration using flake to manage NixOS";
# Inputs
# https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html#flake-inputs
inputs = {
#############################
# NixOS-related inputs
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-26.05";
nixos-hardware = {
url = "github:NixOS/nixos-hardware";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-wsl.url = "github:NixOS/nixpkgs/nixos-24.11";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
flake-registry = {
url = "github:nixos/flake-registry";
flake = false;
};
#############################
# Nix package management
determinate-nix.url = "https://flakehub.com/f/DeterminateSystems/nix-src/*";
determinate-nixd.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
# The organisation's shared infrastructure: the reusable runner router and
# the runner-pool NixOS module now live in peasant-labs/infra, not here. The
# pool module is a base module so every standard host can enable it.
infra = {
url = "github:peasant-labs/infra";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
home-manager-wsl = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs-wsl";
};
#############################
# Other software
niri = {
url = "github:sodiboo/niri-flake";
inputs.nixpkgs.follows = "nixpkgs-stable";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
# niri-flake pins its own `niri-stable` to the v25.08 tag and never bumps
# it, so pin it to the current release ourselves. `niri-unstable` already
# tracks YaLTeR/niri main; declared explicitly for clarity.
inputs.niri-stable.url = "github:YaLTeR/niri/v26.04";
inputs.niri-unstable.url = "github:YaLTeR/niri";
};
llm-agents = {
url = "github:numtide/llm-agents.nix";
};
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-openclaw = {
url = "github:openclaw/nix-openclaw";
inputs.nixpkgs.follows = "nixpkgs";
};
#----------------------------------------
# My stuff
aura-plugins = {
url = "github:dayvidpham/aura-plugins";
inputs.nixpkgs.follows = "nixpkgs-stable";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
inputs.nixpkgs-unstable.follows = "nixpkgs-unstable";
};
openclaw-modules = {
url = "github:dayvidpham/nix-openclaw-vm/develop";
inputs.nixpkgs.follows = "nixpkgs";
};
beads = {
url = "github:dayvidpham/beads/main-fork";
inputs.nixpkgs.follows = "nixpkgs";
};
strike = {
url = "github:jonathanung/strike";
inputs.nixpkgs.follows = "nixpkgs";
};
#----------------------------------------
# Zig
zig-flake = {
url = "github:silversquirl/zig-flake/compat";
inputs.nixpkgs.follows = "nixpkgs";
};
zls = {
url = "github:zigtools/zls";
inputs.zig-flake.follows = "zig-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
#----------------------------------------
# Secrets management
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self
# NixOS-related
, nixpkgs
, infra
, nixpkgs-unstable
, nixpkgs-stable
, nixos-hardware
, nixpkgs-wsl
, nixos-wsl
, flake-registry
# Package management
, determinate-nix
, determinate-nixd
, home-manager
, home-manager-wsl
# Community tools
, niri
, llm-agents
, microvm
, nix-openclaw
, sops-nix
, zig-flake
, zls
# My stuff
, openclaw-modules
, aura-plugins
, beads
, strike
, ...
}:
let
system = "x86_64-linux";
nixpkgs-options = {
inherit system;
config = {
allowUnfree = true;
# Deliberately not global: cudaSupport changes the hashes of
# unrelated packages (e.g. gimp via gegl/suitesparse), so they miss
# cache.nixos.org. Enable it per-package or per-project instead.
};
overlays = [
# zig tools
(final: prev: {
zig_nightly = zig-flake.packages.${system}.nightly;
zls_nightly = zls.packages.${system}.zls;
})
# NOTE: determinate-nix.overlays.default removed — wasmtime.nix requires
# rust_1_89 which was dropped from nixpkgs 25.11 (only rust_1_91 remains).
# Re-enable when DeterminateSystems ships a compatible release.
#determinate-nix.overlays.default
(prev: final: {
llm-agents = llm-agents.packages.${system};
})
nix-openclaw.overlays.default
# Override openclaw to disable extended tools (whisper/torch/triton)
# Note: nodejs/pnpm excluded to avoid collision with system packages
(final: prev: {
openclaw = prev.openclaw.override {
extendedTools = with final; [
git
curl
jq
python3
ffmpeg
ripgrep
go
uv
];
};
})
# Beads issue tracker — wrap with dolt runtime dependency
(final: prev: {
beads =
let
base = beads.packages.${final.stdenv.hostPlatform.system}.default;
in
final.runCommand "beads-wrapped"
{
nativeBuildInputs = [ final.makeWrapper ];
} ''
mkdir -p $out/bin
cp -r ${base}/* $out/
wrapProgram $out/bin/bd --prefix PATH : ${final.lib.makeBinPath [ final.dolt ]}
ln -sf bd $out/bin/beads
'';
})
# NOTE: My own packages and programs
(final: prev: {
run-cwd = with prev; callPackage ./packages/run-cwd.nix { };
scythe = with prev; callPackage ./packages/scythe.nix {
output-dir = "$HOME/Pictures/scythe";
};
waybar-balcony = with prev; callPackage ./packages/themes/balcony/waybar {
rofi = rofi-unwrapped;
};
ImPlay = with prev; callPackage ./packages/implay.nix { };
})
];
};
pkgs = import nixpkgs nixpkgs-options;
pkgs-unstable = import nixpkgs-unstable (
nixpkgs-options
// {
# Temporary: nixos-unstable pairs zotero 10.x with firefox-esr-153,
# which Zotero 10.x does not support; feed it ESR 140 (see
# packages/zotero) until the channel carries the upstream fix
# (nixpkgs#569006).
overlays = nixpkgs-options.overlays ++ [
(final: prev: {
zotero = prev.callPackage ./packages/zotero {
firefox-esr-unwrapped = pkgs-stable.firefox-esr-140-unwrapped;
};
})
];
}
);
pkgs-stable = import nixpkgs-stable nixpkgs-options;
pkgs-wsl = import nixpkgs-wsl nixpkgs-options;
lib = pkgs.lib;
#############################
# Feature Module Registry
# Maps feature names to their corresponding NixOS modules
# These are OPTIONAL features that hosts can enable
featureModules = {
# WSL support (only needed for WSL hosts)
wsl = nixos-wsl.nixosModules.default // {
system.build.installBootLoader = lib.mkForce "${pkgs.coreutils}/bin/true";
};
};
#############################
# Base modules included in ALL standard hosts
# This ensures consistent module availability - features are controlled via enable options
baseModules = [
# Core infrastructure
determinate-nixd.nixosModules.default
niri.nixosModules.niri
microvm.nixosModules.host
sops-nix.nixosModules.sops
openclaw-modules.nixosModules.default
# The runner pool module is org-owned infrastructure. See
# peasant-labs/infra AGENTS.md; the Containerfile and the publishing
# workflow that signs the image moved there with it.
infra.nixosModules.default
infra.nixosModules.runner-dispatcher
# Custom modules
./modules/nixos
noChannelModule
];
# NOTE: Needs to be defined here to have access to nixpkgs and home-manager inputs
noChannelModule = {
nix.settings.experimental-features = [ "nix-command" "flakes" "fetch-closure" ];
nix.channel.enable = false;
nix.registry.nixpkgs.flake = nixpkgs;
nix.registry.home-manager.flake = home-manager;
nix.registry.nixpkgs-unstable.flake = nixpkgs-unstable;
nix.registry.nixpkgs-stable.flake = nixpkgs-stable;
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
environment.etc."nix/inputs/nixpkgs-unstable".source = "${nixpkgs-unstable}";
environment.etc."nix/inputs/nixpkgs-stable".source = "${nixpkgs-stable}";
environment.etc."nix/inputs/home-manager".source = "${home-manager}";
environment.etc."nixos/flake.nix".source = "/home/minttea/dotfiles/flake.nix";
nix.nixPath = [
"nixos-config=/etc/nixos/flake.nix"
"nixpkgs=/etc/nix/inputs/nixpkgs"
"nixpkgs-unstable=/etc/nix/inputs/nixpkgs-unstable"
"nixpkgs-stable=/etc/nix/inputs/nixpkgs-stable"
"home-manager=/etc/nix/inputs/home-manager"
];
nix.settings.nix-path = [
"nixos-config=/etc/nixos/flake.nix"
"nixpkgs=/etc/nix/inputs/nixpkgs"
"nixpkgs-unstable=/etc/nix/inputs/nixpkgs-unstable"
"nixpkgs-stable=/etc/nix/inputs/nixpkgs-stable"
"home-manager=/etc/nix/inputs/home-manager"
];
nix.settings.flake-registry = "${flake-registry}/flake-registry.json";
};
# NOTE: Utils and enum types
libmint =
import ./modules/nixos/libmint.nix {
inherit lib;
lib-hm = home-manager.outputs.lib.hm;
inherit (pkgs) runCommandLocal;
};
# NOTE: Common args to be passed to nixosConfigs and homeConfigurations
specialArgs = {
inherit
pkgs-unstable
pkgs-stable
libmint
niri
microvm
nix-openclaw
beads
sops-nix
;
# Shim: openclaw-vm module expects opencode flake output shape
# but we consume opencode from llm-agents overlay instead
opencode = { packages.${system}.opencode = pkgs-unstable.llm-agents.opencode; };
};
extraSpecialArgs = {
inherit
pkgs-unstable
pkgs-stable
niri
nix-openclaw
beads
strike
sops-nix
;
};
#############################
# Host Builder
# Creates a NixOS configuration with base modules + optional features
#
# All hosts get the same base modules (sops, niri, microvm, etc.)
# Features are controlled via enable options in host configuration
# Only truly host-specific modules (like WSL) are passed as features
#
# Arguments:
# name: Host name (used to find ./hosts/${name}/configuration.nix)
# features: List of optional feature names (e.g., ["wsl"])
# extraModules: Additional modules to include (optional)
# hostSpecialArgs: Additional specialArgs to merge (optional)
mkHost =
{ name
, features ? [ ]
, extraModules ? [ ]
, hostSpecialArgs ? { }
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = specialArgs // hostSpecialArgs;
modules =
# Base modules (always included)
baseModules
# Optional feature modules (from registry)
++ (builtins.map (f: featureModules.${f}) features)
# Host-specific configuration
++ [ ./hosts/${name}/configuration.nix ]
# Any additional modules
++ extraModules;
};
# Minimal host builder for special cases (e.g., microVMs)
mkMinimalHost =
{ name
, modules
, hostSpecialArgs ? { }
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = hostSpecialArgs;
modules = modules;
};
in
{
# Used with `nixos-rebuild --flake .#<hostname>`
# nixosConfigurations."<hostname>".config.system.build.toplevel must be a derivation
nixosConfigurations = {
# Standard workstation hosts - all base modules included automatically
flowX13 = mkHost {
name = "flowX13";
extraModules = [
({ config, lib, ... }@args:
lib.mkIf (!config.isSpecialisation)
(import nixos-hardware.nixosModules.common-gpu-nvidia-disable args))
];
};
desktop = mkHost { name = "desktop"; };
# WSL hosts - need the wsl feature module
wsl = mkHost {
name = "wsl";
features = [ "wsl" ];
};
flowX13-wsl = mkHost {
name = "flowX13-wsl";
features = [ "wsl" ];
};
# LLM Sandbox microVM - minimal standalone configuration
# Note: specialArgs.pkgs warning is expected - microvm module design
llm-sandbox = mkMinimalHost {
name = "llm-sandbox";
hostSpecialArgs = { inherit pkgs pkgs-unstable; };
modules = [
microvm.nixosModules.microvm
./modules/nixos/virtualisation/llm-sandbox/guest.nix
];
};
# Debug runner VM - standalone, started by the user, no host units.
runner-vm-debug = mkMinimalHost {
name = "runner-vm-debug";
modules = [
microvm.nixosModules.microvm
./modules/nixos/virtualisation/runner-vm-debug/guest.nix
];
};
# OpenClaw microVM - runs openclaw gateway with network access to safemolt
# Deprecated for now: unmaintained OpenClaw package evaluation breaks flake check.
# Keep this standalone definition for restoration once package evaluation is fixed.
# openclaw-vm = mkMinimalHost {
# name = "openclaw-vm";
# hostSpecialArgs = {
# inherit pkgs pkgs-unstable nix-openclaw;
# # Shim: openclaw-vm module expects opencode flake output shape
# # but we consume opencode from llm-agents overlay instead
# opencode = { packages.${system}.opencode = pkgs-unstable.llm-agents.opencode; };
# };
# modules = [
# microvm.nixosModules.microvm
# openclaw-modules.nixosModules.openclaw-vm-guest
# ];
# };
};
packages.${system} = {
runner-vm-debug = self.nixosConfigurations.runner-vm-debug.config.microvm.declaredRunner;
passt = pkgs.passt;
virtiofsd = pkgs.virtiofsd;
pinentry-tmux = pkgs-unstable.callPackage ./packages/pinentry-tmux { };
};
checks.${system}.flowX13-gpu-profiles =
let
base = self.nixosConfigurations.flowX13.config;
enabled = base.specialisation.nvidia-enabled.configuration;
baseToplevel = base.system.build.toplevel;
enabledToplevel = enabled.system.build.toplevel;
baseUdev = base.services.udev.extraRules;
enabledUdev = enabled.services.udev.extraRules;
baseModprobe = base.boot.extraModprobeConfig;
enabledModprobe = enabled.boot.extraModprobeConfig;
upstreamClasses = [ "0x0c0330" "0x0c8000" "0x040300" "0x03[0-9]*" ];
upstreamModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
disabledOnlyModules = [ "nvidia" "nvidia_drm" "nvidia_modeset" ];
enabledVideoDrivers = [ "nvidia" "amdgpu" "modesetting" ];
hasAll = values: collection: builtins.all (value: builtins.elem value collection) values;
hasNo = values: collection: builtins.all (value: !(builtins.elem value collection)) values;
containsAll = values: text: builtins.all (value: lib.hasInfix value text) values;
containsNo = values: text: builtins.all (value: !(lib.hasInfix value text)) values;
cudaPackages = [ pkgs.cudatoolkit pkgs.cudaPackages.cudnn pkgs.cudaPackages.cuda_cudart ];
drmLinks = {
card-igpu = "/dev/dri/by-path/pci-0000:08:00.0-card";
card-dgpu = "/dev/dri/by-path/pci-0000:01:00.0-card";
render-igpu = "/dev/dri/by-path/pci-0000:08:00.0-render";
render-dgpu = "/dev/dri/by-path/pci-0000:01:00.0-render";
};
# niri config is split into a shared base plus tiny per-host overlays
# that `include` it. NIRI_CONFIG selects an overlay by (out-of-store)
# repo path, so the check copies the whole config directory into the
# store and validates the overlay there.
niriConfigDir = ./modules/home-manager/desktops/wayland/niri;
enabledNiriConfig = enabled.environment.sessionVariables.NIRI_CONFIG;
loaderConfig = base.boot.loader.systemd-boot.extraFiles."loader/loader.conf";
in
assert lib.assertMsg (!base.isSpecialisation) "Flow X13 base must not evaluate as a specialization";
assert lib.assertMsg (!base.CUSTOM.hardware.nvidia.enable) "Flow X13 base must keep custom NVIDIA policy disabled";
assert lib.assertMsg (!base.CUSTOM.hardware.nvidia.proprietaryDrivers.enable) "Flow X13 base must keep proprietary NVIDIA policy disabled";
assert lib.assertMsg (base.services.xserver.videoDrivers == [ "modesetting" ]) "Flow X13 base must select only the modesetting X server driver";
assert lib.assertMsg (!base.services.supergfxd.enable) "Flow X13 base must keep supergfxd disabled";
assert lib.assertMsg (!base.hardware.nvidia.prime.sync.enable) "Flow X13 base must not enable PRIME sync";
assert lib.assertMsg (!base.hardware.nvidia.prime.reverseSync.enable) "Flow X13 base must not enable reverse PRIME sync";
assert lib.assertMsg (!base.hardware.nvidia.prime.offload.enable) "Flow X13 base must not enable PRIME offload";
assert lib.assertMsg (hasNo cudaPackages base.environment.systemPackages) "Flow X13 base must not include enabled-only CUDA packages";
assert lib.assertMsg (!(base.environment.variables ? WLR_DRM_DEVICES)) "Flow X13 base must not set WLR_DRM_DEVICES";
assert lib.assertMsg (containsAll upstreamClasses baseUdev) "Flow X13 base is missing an upstream NVIDIA PCI removal rule";
assert lib.assertMsg (hasAll upstreamModules base.boot.blacklistedKernelModules) "Flow X13 base is missing an upstream NVIDIA kernel-module blacklist entry";
assert lib.assertMsg (containsAll [ "blacklist nouveau" "options nouveau modeset=0" ] baseModprobe) "Flow X13 base is missing the upstream nouveau modprobe policy";
assert lib.assertMsg enabled.isSpecialisation "Flow X13 nvidia-enabled must evaluate as a specialization";
assert lib.assertMsg enabled.CUSTOM.hardware.nvidia.enable "Flow X13 nvidia-enabled must enable custom NVIDIA policy";
assert lib.assertMsg enabled.CUSTOM.hardware.nvidia.proprietaryDrivers.enable "Flow X13 nvidia-enabled must select proprietary NVIDIA policy";
assert lib.assertMsg (enabled.services.xserver.videoDrivers == enabledVideoDrivers) "Flow X13 nvidia-enabled must select the exact NVIDIA, AMDGPU, and modesetting driver list";
assert lib.assertMsg enabled.hardware.nvidia.modesetting.enable "Flow X13 nvidia-enabled must enable NVIDIA DRM modesetting";
assert lib.assertMsg enabled.hardware.nvidia.prime.sync.enable "Flow X13 nvidia-enabled must use PRIME sync";
assert lib.assertMsg (!enabled.hardware.nvidia.prime.reverseSync.enable) "Flow X13 nvidia-enabled must not use reverse PRIME sync";
assert lib.assertMsg (!enabled.hardware.nvidia.prime.offload.enable) "Flow X13 nvidia-enabled must not use PRIME offload";
assert lib.assertMsg (!enabled.hardware.nvidia.prime.offload.enableOffloadCmd) "Flow X13 nvidia-enabled must not install the PRIME offload command";
assert lib.assertMsg (!enabled.hardware.nvidia.powerManagement.finegrained) "Flow X13 nvidia-enabled must not use fine-grained offload power management";
assert lib.assertMsg (enabled.hardware.nvidia.prime.nvidiaBusId == "PCI:1:0:0") "Flow X13 nvidia-enabled has the wrong NVIDIA PRIME bus ID";
assert lib.assertMsg (enabled.hardware.nvidia.prime.amdgpuBusId == "PCI:8:0:0") "Flow X13 nvidia-enabled has the wrong AMD PRIME bus ID";
assert lib.assertMsg (!enabled.services.supergfxd.enable) "Flow X13 nvidia-enabled must keep supergfxd disabled";
assert lib.assertMsg (hasAll cudaPackages enabled.environment.systemPackages) "Flow X13 nvidia-enabled must include the CUDA runtime closure";
assert lib.assertMsg (hasAll (builtins.attrNames drmLinks) (builtins.attrNames enabled.environment.etc)) "Flow X13 nvidia-enabled must expose all card and render device links";
assert lib.assertMsg (!(enabled.environment.variables ? WLR_DRM_DEVICES)) "Flow X13 nvidia-enabled must not set WLR_DRM_DEVICES";
assert lib.assertMsg (lib.hasSuffix "modules/home-manager/desktops/wayland/niri/config.flowX13-nvidia.kdl" enabledNiriConfig) "Flow X13 nvidia-enabled must select the flowX13 niri overlay";
assert lib.assertMsg (containsNo upstreamClasses enabledUdev) "Flow X13 nvidia-enabled inherited an upstream NVIDIA PCI removal rule";
assert lib.assertMsg (hasNo disabledOnlyModules enabled.boot.blacklistedKernelModules) "Flow X13 nvidia-enabled inherited a disable-only NVIDIA kernel-module blacklist entry";
assert lib.assertMsg (containsNo [ "blacklist nouveau" "options nouveau modeset=0" ] enabledModprobe) "Flow X13 nvidia-enabled inherited the upstream nouveau modprobe policy";
assert lib.assertMsg (builtins.attrNames base.specialisation == [ "nvidia-enabled" ]) "Flow X13 must expose only the nvidia-enabled specialization";
pkgs.runCommand "flowX13-gpu-profiles"
{
nativeBuildInputs = [ niri.packages.${system}.niri-unstable ];
}
''
cp -r ${niriConfigDir} niri-config
grep -F 'render-drm-device "/dev/dri/by-path/pci-0000:01:00.0-render"' niri-config/config.flowX13-nvidia.kdl
niri validate --config niri-config/config.flowX13-nvidia.kdl
grep -F 'default @saved' ${loaderConfig}
test "$(readlink ${enabled.environment.etc.card-igpu.source})" = ${lib.escapeShellArg drmLinks.card-igpu}
test "$(readlink ${enabled.environment.etc.card-dgpu.source})" = ${lib.escapeShellArg drmLinks.card-dgpu}
test "$(readlink ${enabled.environment.etc.render-igpu.source})" = ${lib.escapeShellArg drmLinks.render-igpu}
test "$(readlink ${enabled.environment.etc.render-dgpu.source})" = ${lib.escapeShellArg drmLinks.render-dgpu}
test -e ${baseToplevel}
test -e ${enabledToplevel}
touch $out
'';
homeConfigurations = {
"minttea@flowX13" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs-unstable;
modules = [
niri.homeModules.niri
aura-plugins.homeManagerModules.aura-config-sync
./modules/home-manager
./programs/neovim
./users/minttea/home.nix
./users/minttea/home.flowX13.nix
];
extraSpecialArgs = extraSpecialArgs // {
GLOBALS.hostName = "flowX13";
GLOBALS.theme = {
name = "balcony";
basePath = ./packages/themes/balcony;
};
};
};
"minttea@desktop" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs-unstable;
modules = [
niri.homeModules.niri
aura-plugins.homeManagerModules.aura-config-sync
#aura-plugins.homeManagerModules.temporal-service
#aura-plugins.homeManagerModules.aurad-service
./modules/home-manager
./programs/neovim
./users/minttea/home.nix
./users/minttea/home.desktop.nix
{
CUSTOM.games.minecraft.enable = false;
programs.lutris.enable = true;
}
];
extraSpecialArgs = extraSpecialArgs // {
GLOBALS.hostName = "desktop";
GLOBALS.theme = {
name = "balcony";
basePath = ./packages/themes/balcony;
};
};
};
"minttea@wsl" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs-unstable;
modules = [
niri.homeModules.niri
aura-plugins.homeManagerModules.aura-config-sync
./modules/home-manager
./programs/neovim
./users/minttea/wsl.nix
];
extraSpecialArgs = extraSpecialArgs // {
GLOBALS.hostName = "wsl";
GLOBALS.theme = {
name = "balcony";
basePath = ./packages/themes/balcony;
};
};
};
"minttea@flowX13-wsl" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs-unstable;
modules = [
niri.homeModules.niri
aura-plugins.homeManagerModules.aura-config-sync
./modules/home-manager
./programs/neovim
./users/minttea/wsl.nix
];
extraSpecialArgs = extraSpecialArgs // {
GLOBALS.hostName = "flowX13-wsl";
GLOBALS.theme = {
name = "balcony";
basePath = ./packages/themes/balcony;
};
};
};
};
homeModules = {
default = (
args@{ config
, lib ? config.lib
, pkgs
, ...
}:
{
imports = [
./modules/home-manager
];
}
);
};
};
}