From ad5d1b6967ca40330bd1dcacacc862faa14a6914 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 22 Feb 2021 13:42:42 +0100 Subject: [PATCH] Remote deploy using nixos-rebuild rather than "nix shell" --- flake.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index d98ccbde..272654b2 100644 --- a/flake.nix +++ b/flake.nix @@ -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";