summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--krops.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/krops.nix b/krops.nix
index 6681007..d9885f8 100644
--- a/krops.nix
+++ b/krops.nix
@@ -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
+ '';
}}
''}
'';