diff options
Diffstat (limited to 'krops.nix')
| -rw-r--r-- | krops.nix | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -2,7 +2,12 @@ # krops.nix - deployment entry point # # SYNOPSIS -# $(nix-build krops.nix --no-out-link --argstr name HOSTNAME -A deploy) +# $(nix-build krops.nix --no-out-link --argstr name HOSTNAME -A ACTION) +# +# ACTIONS +# deploy build the system on the target and switch to it +# diff build the system on the target and show what switching to it +# would change # { lib ? import ~/sync/src/krops/lib , pkgs ? import ~/sync/src/krops/pkgs {} @@ -41,9 +46,12 @@ ]; deploy = hrm.legacy.deploy; + diff = hrm.legacy.diff; hrm.legacy.deploy = mkAction "legacy" "deploy"; + hrm.legacy.diff = mkAction "legacy" "diff"; hrm.flake.deploy = mkAction "flake" "deploy"; + hrm.flake.diff = mkAction "flake" "diff"; mkAction = build-method: deploy-action: let target' = lib.mkTarget target; @@ -84,6 +92,11 @@ echo 'Configuration is already up to date' >&2 fi ''; + diff = /* sh */ '' + nix --extra-experimental-features nix-command \ + store diff-closures /run/current-system "$system" + "$system"/bin/switch-to-configuration dry-activate + ''; }} ''} ''; |
