Require init.el exists
Although a completely empty DOOMDIR seems to work (at least for build purposes), I doubt Doom actually supports this. And it requires some extra checks on our side as well. Just check in a trivial DOOMDIR and use that instead.
This commit is contained in:
parent
f8fcb9f904
commit
1399755050
5 changed files with 8 additions and 15 deletions
15
doom.nix
15
doom.nix
|
|
@ -37,7 +37,7 @@
|
|||
makeBinaryWrapper,
|
||||
}:
|
||||
let
|
||||
inherit (lib) optionalAttrs optionalString pathExists;
|
||||
inherit (lib) optionalAttrs optionalString;
|
||||
|
||||
# Step 1: determine which Emacs packages to pull in.
|
||||
#
|
||||
|
|
@ -225,19 +225,10 @@ let
|
|||
emacsWithPackages = doomEmacsPackages.emacsWithPackages (epkgs: (map (p: epkgs.${p}) (builtins.attrNames doomPackageSet)));
|
||||
|
||||
# Step 4: build a final DOOMDIR with packages.el from step 1.
|
||||
|
||||
finalInitFile = let
|
||||
doomInitFile = "${doomDir}/init.el";
|
||||
in
|
||||
if pathExists doomInitFile
|
||||
then concatText "doom-init" [ ./pre-init.el doomInitFile ]
|
||||
else ./pre-init.el;
|
||||
|
||||
finalInitFile = concatText "doom-init" [ ./pre-init.el "${doomDir}/init.el" ];
|
||||
finalDoomDir = runCommand "doom-dir" {} ''
|
||||
mkdir $out
|
||||
if [[ -n "$(ls -A1 ${doomDir})" ]]; then
|
||||
ln -s ${doomDir}/* $out/
|
||||
fi
|
||||
ln -s ${doomDir}/* $out/
|
||||
# yasnippet logs an error at startup if snippets/ does not exist.
|
||||
if ! [[ -e $out/snippets ]]; then
|
||||
mkdir $out/snippets
|
||||
|
|
|
|||
2
doomdirs/minimal/init.el
Normal file
2
doomdirs/minimal/init.el
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
;; Doom doesn't like a completely empty doom! block.
|
||||
(doom! :config default)
|
||||
|
|
@ -29,9 +29,9 @@
|
|||
# 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 // { doomDir = pkgs.emptyDirectory; });
|
||||
doom-full = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { full = true; doomDir = pkgs.emptyDirectory; });
|
||||
doom-example = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { doomDir = ./example; });
|
||||
doom-minimal = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { doomDir = ./doomdirs/minimal; });
|
||||
doom-full = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { full = true; doomDir = ./doomdirs/minimal; });
|
||||
doom-example = pkgsWithEmacsOverlay.callPackage ./doom.nix (common // { doomDir = ./doomdirs/example; });
|
||||
});
|
||||
overlays.default = final: prev:
|
||||
let
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue