flake.nix: format, remove exec, check if hostname is correct
This commit is contained in:
parent
1460fa8131
commit
df2549e712
|
@ -136,21 +136,22 @@
|
|||
# Can be run with `nix run c3d2#…-nixos-rebuild switch`
|
||||
"${name}-nixos-rebuild" = pkgs.writeScriptBin "${name}-nixos-rebuild" ''
|
||||
#!${pkgs.runtimeShell} -e
|
||||
[[ $(ssh ${target} cat /etc/hostname) == ${name} ]]
|
||||
nix copy --to ssh://${target} ${secrets}
|
||||
nix copy --to ssh://${target} ${self}
|
||||
exec ssh ${target} nixos-rebuild ${rebuildArg} $@
|
||||
ssh ${target} nixos-rebuild ${rebuildArg} "$@"
|
||||
'';
|
||||
|
||||
"${name}-nixos-rebuild-local" = pkgs.writeScriptBin "${name}-nixos-rebuild" ''
|
||||
#!${pkgs.runtimeShell} -e
|
||||
set -x
|
||||
[[ $(ssh ${target} cat /etc/hostname) == ${name} ]]
|
||||
nix copy --to ssh://${target} ${profile}
|
||||
exec ssh ${target} "${profile}/bin/switch-to-configuration $@"
|
||||
ssh ${target} "${profile}/bin/switch-to-configuration $*"
|
||||
'';
|
||||
|
||||
"${name}-cleanup" = pkgs.writeScriptBin "${name}-cleanup" ''
|
||||
#!${pkgs.runtimeShell} -e
|
||||
exec ssh ${target} "time nix-collect-garbage -d && time nix-store --optimise"
|
||||
ssh ${target} "time nix-collect-garbage -d && time nix-store --optimise"
|
||||
'';
|
||||
}) {} (builtins.attrNames flakifiedHosts) //
|
||||
|
||||
|
|
Loading…
Reference in New Issue