diff options
Diffstat (limited to 'krops.nix')
| -rw-r--r-- | krops.nix | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -9,6 +9,9 @@ # diff build the system on the target and show what switching to it # would change, and what its enstate would do with the # submissions +# diff.enstate +# show what the running system's enstate would do with the +# submissions, without delivering them # enstate deliver only the enstate submissions, for the running system to # take # bootimg build the boot image (spec.nix's bootimg, an attribute of the @@ -154,7 +157,9 @@ rec { lib.filterAttrs (name: _: lib.hasPrefix "secrets" name) sources; deploy = hrm.legacy.deploy; - diff = hrm.legacy.diff; + diff = hrm.legacy.diff // { + enstate = enstateDiff; + }; hrm.legacy.deploy = mkAction "legacy" "deploy"; hrm.legacy.diff = mkAction "legacy" "diff"; @@ -289,6 +294,19 @@ rec { ''} ''; + # What enstate would do with the submissions, under the running system. + enstateDiff = + assert lib.assertMsg (sourceLists != {}) + "${name}: no enstate sources to submit"; + pkgs.writers.writeDash "${name}-diff-enstate" /* sh */ '' + set -efu + ${enstateSteps.packAndCopy} + ${pkgs.krops.runShell (lib.mkTarget target) {} /* sh */ '' + set -efu + ${enstateSteps.plan "/run/current-system"} + ''} + ''; + mkTargetBuildAction = build-method: deploy-action: let target' = lib.mkTarget target; name' = "${name}-deploy-${build-method}-${deploy-action}"; |
