diff options
author | aszlig <aszlig@nix.build> | 2020-02-10 09:59:15 +0100 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2020-02-10 09:59:15 +0100 |
commit | 1908cd711742abcf05deb19c0d77c642a28e260a (patch) | |
tree | c007e21c7e7088336e2a596a02f61d08a1913987 /pkgs | |
parent | ab14b5ad41595219ca62cb4ea929bc3bbc46ca8d (diff) |
taalo-build: Combine ssh and ssh-ng store protocol
For some reason which I haven't been able to debug yet, the legacy SSH remote store protocol is way faster when it comes to copying files. To cope with this for now, we now use the legacy protocol for copying and the new protocol for the actual remote build. Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/taalo-build/default.nix | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pkgs/taalo-build/default.nix b/pkgs/taalo-build/default.nix index 09ff41d4..1c24b316 100644 --- a/pkgs/taalo-build/default.nix +++ b/pkgs/taalo-build/default.nix @@ -1,20 +1,25 @@ -{ stdenv, lib, runCommandLocal, coreutils, nixUnstable }: +{ stdenv, lib, runCommandLocal, coreutils, nix }: let - nixRemote = "ssh-ng://nix-remote-build@taalo.headcounter.org?compress=true"; - remoteEsc = lib.escapeShellArg nixRemote; - mkNix = cmd: lib.escapeShellArg "${nixUnstable}/bin/${cmd}"; + mkNixRemote = proto: let + hostAndQuery = "nix-remote-build@taalo.headcounter.org?compress=true"; + in "${proto}://${hostAndQuery}"; + + remoteCopyEsc = lib.escapeShellArg (mkNixRemote "ssh"); + remoteEsc = lib.escapeShellArg (mkNixRemote "ssh-ng"); + mkNix = cmd: lib.escapeShellArg "${nix}/bin/${cmd}"; errorOnly = cmd: "if ! outerr=\"$(${cmd} 2>&1)\"; then echo \"$outerr\" >&2; exit 1; fi"; remoteRealize = pre: arg: '' - ${errorOnly "${mkNix "nix"} copy -s --quiet --to ${remoteEsc} ${arg}"} + ${errorOnly "${mkNix "nix"} copy -s --quiet --to ${remoteCopyEsc} ${arg}"} NIX_REMOTE=${remoteEsc} ${pre}${mkNix "nix-store"} -r ${arg} ''; - emitScript = content: - "echo -n ${lib.escapeShellArg "#!${stdenv.shell}\nset -e\n${content}"}"; + emitScript = content: let + result = "#!${stdenv.shell}\nset -e\n${content}"; + in "echo -n ${lib.escapeShellArg result}"; in runCommandLocal "taalo-build" {} '' mkdir -p "$out/bin" |