Create simple 'push-to' shell function

This commit is contained in:
Malte Tammena 2022-01-16 15:55:37 +01:00
parent 2b124487cf
commit d113d9ac5a

View file

@ -338,6 +338,16 @@
writeScriptBin "all-hosts" ''
nix eval --json .#nixosConfigurations --apply builtins.attrNames 2>/dev/null | jq -r .[]
'')
(with pkgs;
writeScriptBin "push-to" ''
if [ -z $2 ]; then
echo "Need 'switch|boot|...'"
exit 1
fi
host=$1
action=$2
nixos-rebuild --flake .#$host --build-host root@$host --target-host root@$host $action
'')
(with pkgs;
writeScriptBin "option" ''
host=$1