diff options
| author | seth <[email protected]> | 2024-07-22 03:27:22 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-07-22 03:27:22 -0400 |
| commit | cec5413fcc0ca6b2049efe5a44f3b3fbe6f5f0a1 (patch) | |
| tree | cd34804b4c674a88f1fdbf03a8c4c9a7abe158ef /templates/nixos/justfile | |
| parent | 8160024f34c51057c8c2956113da6a3974d931d6 (diff) | |
templates: modernize
Diffstat (limited to 'templates/nixos/justfile')
| -rw-r--r-- | templates/nixos/justfile | 53 |
1 files changed, 12 insertions, 41 deletions
diff --git a/templates/nixos/justfile b/templates/nixos/justfile index 7c44f0d..a6f8655 100644 --- a/templates/nixos/justfile +++ b/templates/nixos/justfile @@ -1,51 +1,22 @@ -alias b := build -alias c := check -alias dr := dry-run +alias b := boot +alias s := switch alias sw := switch alias t := test -alias u := update -alias ui := update-input -rebuildArgs := "--verbose" rebuild := if os() == "macos" { "darwin-rebuild" } else { "nixos-rebuild" } default: - @just --choose + @just --choose -[private] -rebuild subcmd *extraArgs="": - {{ rebuild }} {{ subcmd }} {{ rebuildArgs }} --flake . {{ extraArgs }} +# Wrapper for `nixos-rebuild`. See `man nixos-rebuild` +rebuild subcmd *args="": + {{ rebuild }} {{ subcmd }} --flake . {{ args }} -boot *extraArgs="": (rebuild "boot" extraArgs) +# Switch to your new configuration when you reboot +boot *args="": (rebuild "boot" args) -build *extraArgs="": (rebuild "build" extraArgs) +# Immediately switch to your new configuration +switch *args="": (rebuild "switch" args) -dry-run *extraArgs="": (rebuild "dry-run" extraArgs) - -switch *extraArgs="": (rebuild "switch" extraArgs) - -test *extraArgs="": (rebuild "test" extraArgs) - -check *args="": - nix flake check \ - --print-build-logs \ - --show-trace \ - --accept-flake-config \ - {{ args }} - -eval system *args="": - nix eval \ - --raw \ - '.#nixosConfigurations.{{ system }}.config.system.build.toplevel' \ - {{ args }} - -update: - nix flake update \ - --commit-lock-file \ - --commit-lockfile-summary "flake: update all inputs" - -update-input input: - nix flake lock \ - --update-input {{ input }} \ - --commit-lock-file \ - --commit-lockfile-summary "flake: update {{ input }}" +# Temporarily switch to your new configuration +test *args="": (rebuild "test" args) |
