summaryrefslogtreecommitdiff
path: root/justfile
blob: 8f6bf9ef8f1b7ff0f6d4da78324c54b59dc6fa76 (plain)
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
alias r := rebuild
alias rr := remote-rebuild
alias e := eval
alias ea := eval-all
alias u := update
alias ui := update-input

rebuild := if os() == "macos" { "darwin-rebuild" } else { "nixos-rebuild" }

default:
    @just --choose

rebuild subcmd *args="":
    {{ rebuild }} \
      {{ subcmd }} \
      --use-remote-sudo \
      --flake {{ justfile_directory() }} \
      {{ args }}

remote-rebuild system subcmd *args="":
    {{ rebuild }} \
      {{ subcmd }} \
      --build-host 'root@{{ system }}' \
      --target-host 'root@{{ system }}' \
      --no-build-nix \
      --use-substitutes \
      --flake '{{ justfile_directory() }}#{{ system }}' \
      {{ args }}

eval system *args="":
    nix eval \
      --no-allow-import-from-derivation \
      '{{ justfile_directory() }}#nixosConfigurations.{{ system }}.config.system.build.toplevel' \
      {{ args }}

eval-all *args="":
    nix flake check --all-systems --no-build {{ justfile_directory() }} {{ args }}

update:
    nix flake update \
      --commit-lock-file \
      --commit-lockfile-summary "flake: update all inputs" \
      {{ justfile_directory() }}

update-input input:
    nix flake update {{ input }} \
      --commit-lock-file \
      --commit-lockfile-summary "flake: update {{ input }}" \
      {{ justfile_directory() }}