diff options
author | aszlig <aszlig@redmoonstudios.org> | 2016-06-04 17:25:43 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2016-06-04 17:25:43 +0200 |
commit | fba5c2469bd5e95857c4ffd9db3dd0529f2485f3 (patch) | |
tree | 5db54b409485c9ae219860b55afdb9a76f55972f /modules/user/aszlig | |
parent | e2b1c14af1ce22117eb213c5d8153bb1aa3a3a2a (diff) |
programs/taalo-build: Add link to derivation file
This is needed to ensure that the .drv file doesn't get garbage collected while we're transferring it to taalo. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/user/aszlig')
-rw-r--r-- | modules/user/aszlig/programs/taalo-build/default.nix | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/user/aszlig/programs/taalo-build/default.nix b/modules/user/aszlig/programs/taalo-build/default.nix index 93523660..71825610 100644 --- a/modules/user/aszlig/programs/taalo-build/default.nix +++ b/modules/user/aszlig/programs/taalo-build/default.nix @@ -61,8 +61,16 @@ let taalo-build = pkgs.writeScriptBin "taalo-build" '' #!${pkgs.stdenv.shell} - drvs="$(nix-instantiate "$@" | cut -d'!' -f1)" || exit 1 - exec ${backend} $drvs + if tmpdir="$("${pkgs.coreutils}/bin/mktemp" -d taalo-build.XXXXXX)"; then + trap "rm -rf '$tmpdir'" EXIT + drvs="$(nix-instantiate --add-root "$tmpdir/derivation" --indirect "$@" \ + | cut -d'!' -f1)" || exit 1 + ${backend} $drvs + exit $? + else + echo "Unable to create temporary directory for build link!" >&2 + exit 1 + fi ''; in { |