Flake for my NixOS devices
1GARGS := if env("SPOON_PATH", "") != "" {"--override-input spoon \"$SPOON_PATH\""} else { "" }
2
3_default:
4 @{{ just_executable() }} --list --unsorted --justfile {{ justfile() }}
5
6[private]
7alias u := update
8# u: update all inputs
9update:
10 nix flake update
11
12[private]
13alias b := build
14# b: build the configuration
15build:
16 nh os build -k . {{ GARGS }}
17
18[private]
19alias bt := boot
20# bt: make the configuration the boot default without activating it
21boot:
22 nh os boot -k . {{ GARGS }}
23
24[private]
25alias s := switch
26# s: activate configuration & add to boot menu
27switch:
28 nh os switch -k --ask . {{ GARGS }}
29
30[private]
31alias c := check
32# c: run all checks for the current system
33check *ARGS:
34 nom build --show-trace ".#uberCheck.$(nix eval --impure --raw --expr 'builtins.currentSystem')" --keep-going {{ GARGS }} {{ ARGS }}
35
36[private]
37alias d := deploy
38# d: deploy the given host
39deploy ACTION="switch" HOST="black-mesa":
40 NIX_SSHOPTS="-p 8069" nixos-rebuild {{ ACTION }} --flake .#{{ HOST }} --build-host {{ HOST }}.lan --target-host {{ HOST }}.lan --sudo --override-input spoon "git+https://codeberg.org/spoonbaker/mono?ref=devel" --refresh
41
42[private]
43alias f := format
44# f: format this flake
45format:
46 nix fmt
47
48[private]
49alias r := repl
50# r: start a debugging repl
51repl:
52 nix repl {{ GARGS }} .#repl
53
54[private]
55alias gc := garbage-collect
56# gc: run a garbage collection
57garbage-collect:
58 nh clean all
59
60[private]
61alias iso := generate-iso
62generate-iso:
63 nom build .#nixosConfigurations.installer.config.system.build.isoImage
64
65