From b5954cf18c7933bde5d952821a8457b64da52d65 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 12 Nov 2017 20:40:59 +0100 Subject: taalo-build: Rewrite as wrapper and move to pkgs We no longer use the legacy SSH store protocol for taalo but the new ssh-ng protocol, which makes the implementation of taalo-build a LOT less clunky. It also didn't make sense to have this as a NixOS module when we after all just emit a static store path without any stuff depending on configuration options. The new implementation basically just wraps nix-build and nix-store -r along with the right NIX_REMOTE variable. With Nix 1.2 this can also be done with the new "nix build" command using the --store option, but unfortunately "nix build" doesn't yet have the same functionality as nix-build. Signed-off-by: aszlig Cc: @Profpatsch, @bendlas --- pkgs/taalo-build/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pkgs/taalo-build/default.nix (limited to 'pkgs/taalo-build') diff --git a/pkgs/taalo-build/default.nix b/pkgs/taalo-build/default.nix new file mode 100644 index 00000000..d9ff8976 --- /dev/null +++ b/pkgs/taalo-build/default.nix @@ -0,0 +1,19 @@ +{ stdenv, lib, runCommand, nixUnstable }: + +let + nixRemote = "ssh-ng://nix-remote-build@taalo.headcounter.org?compress=true"; + + mkScript = cmd: lib.escapeShellArg '' + #!${stdenv.shell} + export NIX_REMOTE=${lib.escapeShellArg nixRemote} + exec ${lib.escapeShellArg nixUnstable}/bin/${cmd} "$@" + ''; + +in runCommand "taalo-build" {} '' + mkdir -p "$out/bin" + + echo -n ${mkScript "nix-build"} > "$out/bin/taalo-build" + echo -n ${mkScript "nix-store -r"} > "$out/bin/taalo-realize" + + chmod +x "$out"/bin/taalo-{build,realize} +'' -- cgit 1.4.1