diff --git a/.gitignore b/.gitignore index 678fe6c2..6886f26e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /result +/result* secrets.nix *.swp *.swo diff --git a/lib/deploy.nix b/lib/deploy.nix index d6fc94e2..fbb4a87b 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -6,7 +6,7 @@ with pkgs.lib; '' #!${pkgs.runtimeShell} export PATH= - nix build ${concatMapStringsSep " " (host: builtins.unsafeDiscardStringContext host.config.system.build.toplevel.drvPath) hosts} + nix build --no-link ${concatMapStringsSep " " (host: builtins.unsafeDiscardStringContext host.config.system.build.toplevel.drvPath) hosts} ${concatMapStrings (host: '' echo "deploying ${host.config.networking.hostName}..." ${host.config.system.build.deployScript} $1 & diff --git a/modules/nixos/deploy/default.nix b/modules/nixos/deploy/default.nix index 38ca2b9f..b09e5014 100644 --- a/modules/nixos/deploy/default.nix +++ b/modules/nixos/deploy/default.nix @@ -58,6 +58,7 @@ in { set -xeo pipefail export PATH=${with pkgs; lib.makeBinPath [ coreutils openssh nix ]} export NIX_SSHOPTS="$NIX_SSHOPTS -p${toString cfg.ssh.port} -T" + nix build ${ builtins.unsafeDiscardStringContext config.system.build.toplevel.drvPath} -o result-${config.networking.hostName} nix copy ${ if cfg.substitute then "-s" else "" } --no-check-sigs --to ssh://root@${cfg.ssh.host} ${config.system.build.toplevel}