Skip to content

Instantly share code, notes, and snippets.

@garbas
Created April 29, 2015 08:56
Show Gist options
  • Save garbas/1cf88be1f44224974d3d to your computer and use it in GitHub Desktop.
Save garbas/1cf88be1f44224974d3d to your computer and use it in GitHub Desktop.
{ tmpdir ? "/custom-tmp"
}:
{
custom_nix = pkgs.stdenv.mkDerivation {
name = "nix-with-custom-tmpdir";
buildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
for script in ${pkgs.nix}/*; do
ln -s $script $out/bin
done
for script in $out/bin/*; do
wrapProgram $script --set TMPDIR "${tmpdir}"
done
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment