Avoid mktemp
Nix promises to run us in an (empty) temporary directory. So we should not need mktemp, we can just use deterministic names. Our temporary directory should already not be leaking into the output (and we enforce that for the profile), so this should just be cleanup that makes debugging slightly easier.
This commit is contained in:
parent
d81e519c86
commit
51e61c24fe
3 changed files with 9 additions and 7 deletions
|
|
@ -14,7 +14,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
mkdir $out $out/loader $out/doomdir $out/profile $out/straight
|
mkdir $out $out/loader $out/doomdir $out/profile $out/straight doomlocaldir home
|
||||||
ln -s $doomDir/* $out/doomdir/
|
ln -s $doomDir/* $out/doomdir/
|
||||||
# yasnippet logs an error at startup if snippets/ does not exist.
|
# yasnippet logs an error at startup if snippets/ does not exist.
|
||||||
if ! [[ -e $out/doomdir/snippets ]]; then
|
if ! [[ -e $out/doomdir/snippets ]]; then
|
||||||
|
|
@ -35,14 +35,14 @@ ln -sf $doomIntermediates/packages.el $out/doomdir/
|
||||||
export DOOMDIR=$out/doomdir
|
export DOOMDIR=$out/doomdir
|
||||||
|
|
||||||
# DOOMLOCALDIR must be writable, Doom creates some subdirectories.
|
# DOOMLOCALDIR must be writable, Doom creates some subdirectories.
|
||||||
export DOOMLOCALDIR=$(mktemp -d)
|
export DOOMLOCALDIR="$PWD/doomlocaldir"
|
||||||
if [[ -n "$profileName" ]]; then
|
if [[ -n "$profileName" ]]; then
|
||||||
export DOOMPROFILELOADFILE=$out/loader/init.el
|
export DOOMPROFILELOADFILE=$out/loader/init.el
|
||||||
$runtimeShell $doomSource/bin/doomscript $buildProfileLoader \
|
$runtimeShell $doomSource/bin/doomscript $buildProfileLoader \
|
||||||
${noProfileHack:+-u} -n "$profileName" -b "$out"
|
${noProfileHack:+-u} -n "$profileName" -b "$out"
|
||||||
|
|
||||||
# With DOOMPROFILE set, doom-state-dir and friends are HOME-relative.
|
# With DOOMPROFILE set, doom-state-dir and friends are HOME-relative.
|
||||||
export HOME=$(mktemp -d)
|
export HOME="$PWD/home"
|
||||||
export DOOMPROFILE="$profileName";
|
export DOOMPROFILE="$profileName";
|
||||||
fi
|
fi
|
||||||
$runtimeShell $doomSource/bin/doomscript $buildProfile \
|
$runtimeShell $doomSource/bin/doomscript $buildProfile \
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ runCommandLocal name
|
||||||
)
|
)
|
||||||
# Set DOOMLOCALDIR somewhere harmless to stop Doom from trying to create it somewhere read-only.
|
# Set DOOMLOCALDIR somewhere harmless to stop Doom from trying to create it somewhere read-only.
|
||||||
''
|
''
|
||||||
mkdir $out
|
mkdir $out doomlocaldir
|
||||||
export DOOMLOCALDIR=$(mktemp -d)
|
export DOOMLOCALDIR="$PWD/doomlocaldir"
|
||||||
$runtimeShell $doomSource/bin/doomscript $script ${scriptArgs}
|
$runtimeShell $doomSource/bin/doomscript $script ${scriptArgs}
|
||||||
''
|
''
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@
|
||||||
# TODO: figure out why this is necessary (there may be a better
|
# TODO: figure out why this is necessary (there may be a better
|
||||||
# solution).
|
# solution).
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
export HOME=$(mktemp -d)
|
mkdir home
|
||||||
|
export HOME="$PWD/home"
|
||||||
'';
|
'';
|
||||||
# TODO: set this properly (melpa2nix requires it).
|
# TODO: set this properly (melpa2nix requires it).
|
||||||
commit = "unset";
|
commit = "unset";
|
||||||
|
|
@ -208,7 +209,8 @@
|
||||||
# Make it byte-compile (see auctex)
|
# Make it byte-compile (see auctex)
|
||||||
company-auctex = esuper.company-auctex.overrideAttrs (attrs: {
|
company-auctex = esuper.company-auctex.overrideAttrs (attrs: {
|
||||||
preBuild = (attrs.preBuild or "") + ''
|
preBuild = (attrs.preBuild or "") + ''
|
||||||
export HOME=$(mktemp -d)
|
mkdir home
|
||||||
|
export HOME="$PWD/home"
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
# Make it byte-compile.
|
# Make it byte-compile.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue