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
6alias u := update
7
8# u: update all inputs
9update:
10 nix flake update
11
12alias b := build
13
14# b: build the configuration
15build:
16 nh os build -k . {{ GARGS }}
17
18alias bt := boot
19
20# bt: make the configuration the boot default without activating it
21boot:
22 nh os boot -k . {{ GARGS }}
23
24alias s := switch
25
26# s: activate configuration & add to boot menu
27switch:
28 nh os switch -k --ask . {{ GARGS }}
29
30alias c := check
31
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
36alias d := deploy
37
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
42alias f := format
43
44# f: format this flake
45format:
46 nix fmt
47
48alias r := repl
49
50# r: start a debugging repl
51repl:
52 nix repl {{ GARGS }} .#repl
53
54alias gc := garbage-collect
55
56# gc: run a garbage collection
57garbage-collect:
58 nh clean all
59
60alias iso := generate-iso
61
62generate-iso:
63 nom build .#nixosConfigurations.installer.config.system.build.isoImage