Create simple 'push-to' shell function
This commit is contained in:
parent
2b124487cf
commit
d113d9ac5a
10
flake.nix
10
flake.nix
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue