Open smancill opened 2 years ago
or maybe stdenv/setup.sh could do it systematically
or maybe stdenv/setup.sh could do it systematically
Random factoid: Gentoo uses HOME=$TMP for builders.
Sometimes tools are very keen on creating something at $HOME
and either fail or have a graceful fallback. I don't think there would be one-size-fits-all path. I'd say it's fine to leave the way to handle it to individual packages.
A function setupHome
as part of stdenv that packages can just call could do the trick?
A function
setupHome
as part of stdenv that packages can just call could do the trick?
We should avoid expanding stdenv and instead use hooks
export HOME=/Users/$(whoami)
This should be removed immediately because it only works on darwin and pollutes your home directory if the sandbox is not enabled.
export HOME=/Users/$(whoami)
This should be removed immediately because it only works on darwin and pollutes your home directory if the sandbox is not enabled.
It is from https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/mobile/xcodeenv/build-app.nix, I don't feel like touching that derivation blindly.
Looks like @svanderburg is the code owner.
Thats scary. Not touching that either...
Describe the bug
Multiple derivations need to set
HOME
to a temporary directory for write access, but there is no agreement on a standard way to do it, so a quick search shows:export HOME=$(mktemp -d)
export HOME="$(mktemp -d)"
export HOME=$TMPDIR
export HOME=$TMPDIR/home
export HOME="$TMPDIR"
export HOME=$TEMPDIR
export HOME="$TEMPDIR"
export HOME=$TMP
export HOME="$TMP/home"
export HOME=$TEMP
export HOME=tmp
export HOME=$NIX_BUILD_TOP
export HOME=$NIX_BUILD_TOP/fake_home
export HOME=$NIX_BUILD_TOP/fake_home
export HOME="$NIX_BUILD_TOP"
export HOME="$NIX_BUILD_TOP"/home
export HOME=$PWD
export HOME=$PWD/HOME
export HOME=$PWD/home
export HOME=$PWD/test-home
export HOME=$(pwd)/check-phase
export HOME=/Users/$(whoami)
export HOME=$(realpath ../dummy-home)
Expected behavior
It should be one standard way to do it.
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.