Remote deploy using nixos-rebuild rather than "nix shell"
This commit is contained in:
parent
ec81b6a28d
commit
ad5d1b6967
|
@ -32,16 +32,15 @@
|
|||
#!${pkgs.runtimeShell}
|
||||
set -ev
|
||||
nix-copy-closure --to ${target} ${self}
|
||||
exec ssh -t ${target} \
|
||||
nix shell \
|
||||
${self}#nixosConfigurations.${name}.config.system.build.toplevel \
|
||||
--command switch-to-configuration $@
|
||||
exec ssh -t ${target} nixos-rebuild --flake ${self}#${name} $@
|
||||
'';
|
||||
mkWake = name:
|
||||
pkgs.writeScriptBin "${name}-wake" ''
|
||||
#!${pkgs.runtimeShell}
|
||||
exec ${pkgs.wol}/bin/wol ${hostRegistry.hosts.${name}.ether}
|
||||
'';
|
||||
# TODO: check if the ethernet address is reachable and if not,
|
||||
# execute wol on a machine in HQ.
|
||||
in {
|
||||
glotzbert-nixos-rebuild = mkDeploy "glotzbert" "glotzbert.hq.c3d2.de";
|
||||
glotzbert-wake = mkWake "glotzbert";
|
||||
|
|
Loading…
Reference in New Issue