From 9a49b9b392fbd8f716e821b3efbf307aae3c92b4 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Tue, 21 Dec 2021 01:47:07 -0500 Subject: [PATCH] morph: move check-updates command --- lib/morph.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/morph.nix b/lib/morph.nix index 8dfd138..11dd903 100644 --- a/lib/morph.nix +++ b/lib/morph.nix @@ -50,8 +50,17 @@ let exec ssh -oForwardAgent=yes -F"${sshConfig}" "root@$ip" -t "cd ${self}; nix develop" ''; + check-updates = pkgs.writeShellScript "check-updates" '' + set -eu + export SSH_CONFIG_FILE=${sshConfig} + res="$(morph build morph.nix)" + diff \ + <(find $res -type l | xargs readlink | sort) \ + <(morph exec morph.nix 'readlink /run/current-system' |& grep '^/nix/store/' | sort) + ''; + in - { inherit jump pkgs sh sshConfig; }; + { inherit check-updates jump pkgs sh sshConfig; }; in { @@ -62,6 +71,7 @@ in export SSH_CONFIG_FILE=${sshConfig} alias ssh='ssh -F${sshConfig}' alias jump=${jump} + alias check-updates=${check-updates} ''; }; @@ -94,12 +104,6 @@ in packages = system: with helpers system; { - check-updates = sh '' - res="$(morph build morph.nix)" - diff \ - <(find $res -type l | xargs readlink | sort) \ - <(morph exec morph.nix 'readlink /run/current-system' |& grep '^/nix/store/' | sort) - ''; livecd-deploy = sh '' config=".#nixosConfigurations.\"$1\".config" ip="$(nix eval --raw "$config.sconfig.morph.deployment.targetHost")"