diff --git a/lib/deploy.nix b/lib/deploy.nix index 82c2fa6..e9f0b69 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -67,8 +67,15 @@ let $c exec -- '[ "$(echo '"'$j'"' | jq -r .$(hostname))" = "$(readlink /run/current-system)" ]' ''; + check-reboots = pkgs.writeShellScript "check-reboots" '' + set -eu + export SSH_CONFIG_FILE=${sshConfig} + c="${pkgs.colmena}/bin/colmena" + $c exec -- '[ "$(readlink /run/booted-system/kernel)" = "$(readlink /run/current-system/kernel)" ]' + ''; + in - { inherit check-updates jump livecd-deploy pkgs sshConfig; }; + { inherit check-updates check-reboots jump livecd-deploy pkgs sshConfig; }; in { @@ -80,6 +87,7 @@ in alias ssh='ssh -F${sshConfig}' alias jump=${jump} alias check-updates=${check-updates} + alias check-reboots=${check-reboots} alias livecd-deploy=${livecd-deploy} alias c=colmena ''; diff --git a/modules/cli/default.nix b/modules/cli/default.nix index 39c1272..1579358 100644 --- a/modules/cli/default.nix +++ b/modules/cli/default.nix @@ -53,20 +53,6 @@ print("compression ratio:", orig_data_size/mem_used_total) '') - (writeShellScriptBin "nixos-check-reboot" '' - set -e - booted="$(readlink /run/booted-system/kernel)" - current="$(readlink /run/current-system/kernel)" - if [ "$booted" = "$current" ] - then - echo OK - exit 0 - else - echo REBOOT NEEDED - exit 1 - fi - '') - (writeScriptBin "zfsram" '' #!${pkgs.python3}/bin/python for ln in open('/proc/spl/kstat/zfs/arcstats').readlines():