Make doomDir mandatory but possibly empty

Having this empty only really makes sense for minimal/full test builds.

Also, /var/empty was not doing what it looks like (it's not accessible
from inside the build sandbox). Use nixpkgs's emptyDirectory instead.
This commit is contained in:
Marien Zwart 2024-04-07 14:12:53 +10:00
parent 3f61282923
commit 0719e304b4
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
/* DOOMDIR / Doom private directory / module. */
doomDir ? "/var/empty",
doomDir,
/* Doom source tree. */
doomSource,
/* Emacs package to build against. */
@ -232,7 +232,7 @@ let
# Step 4: build a final DOOMDIR with packages.el from step 1.
finalDoomDir = runCommand "doom-dir" {} ''
mkdir $out
if [[ -e ${doomDir} ]]; then
if [[ -n "$(ls -A1 ${doomDir})" ]]; then
ln -s ${doomDir}/* $out/
fi
ln -sf ${doomIntermediates}/packages.el $out/

View file

@ -25,8 +25,8 @@
# Current Doom + NixOS 23.11 requires emacs-overlay: Doom pins
# emacs-fish-completion, which moved from gitlab to github recently
# enough stable nixpkgs pulls it from the wrong source.
doom-minimal = pkgsWithEmacsOverlay.callPackage ./doom.nix common;
doom-full = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { full = true; });
doom-minimal = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { doomDir = pkgs.emptyDirectory; });
doom-full = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { full = true; doomDir = pkgs.emptyDirectory; });
doom-example = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { doomDir = ./example; });
doomEmacs = args: pkgsWithEmacsOverlay.callPackage ./doom.nix (common // args);
});