Support specifying extra emacs pkgs from nixpkgs
This commit is contained in:
parent
e611b27529
commit
9aca28b012
3 changed files with 24 additions and 4 deletions
|
|
@ -67,6 +67,10 @@ in {
|
|||
minimalEmacs = (makeDoomPackages (common // {
|
||||
doomDir = minimalDoomDir;
|
||||
})).emacsWithDoom;
|
||||
minimalExtraPackages = mkDoom {
|
||||
doomDir = minimalDoomDir;
|
||||
extraPackages = epkgs: [ epkgs.vterm epkgs.treesit-grammars.with-all-grammars ];
|
||||
};
|
||||
allModules = mkDoom { doomDir = allModsDoomDir; };
|
||||
allModulesAndFlags = mkDoom { doomDir = allFlagsDoomDir; };
|
||||
example = mkDoom { doomDir = ./doomdir; };
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@
|
|||
noProfileHack ? false,
|
||||
/* Use fetchTree instead of fetchGit for package fetches. */
|
||||
experimentalFetchTree ? false,
|
||||
/* Extra emacs packages from nixpkgs */
|
||||
extraPackages ? epkgs: [ ],
|
||||
|
||||
callPackages,
|
||||
git,
|
||||
|
|
@ -330,8 +332,8 @@ let
|
|||
|
||||
# Step 3: Build an emacsWithPackages, pulling all packages from step 1 from
|
||||
# the set from step 2.
|
||||
emacsWithPackages = doomEmacsPackages.emacsWithPackages
|
||||
(epkgs: (map (p: epkgs.${p}) (builtins.attrNames doomPackageSet)));
|
||||
emacsWithPackages = doomEmacsPackages.emacsWithPackages
|
||||
(epkgs: (map (p: epkgs.${p}) (builtins.attrNames doomPackageSet)) ++ (extraPackages epkgs));
|
||||
|
||||
# Step 4: build a DOOMDIR, Doom profile and profile loader using Emacs from
|
||||
# step 3 and packages.el from step 1.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
let
|
||||
cfg = config.programs.doom-emacs;
|
||||
inherit (lib) literalExpression mkEnableOption mkIf mkMerge mkOption types;
|
||||
inherit (lib) literalExpression mkEnableOption mkIf mkMerge mkOption types hm;
|
||||
in {
|
||||
options = {
|
||||
programs.doom-emacs = {
|
||||
|
|
@ -94,13 +94,27 @@ in {
|
|||
readOnly = true;
|
||||
description = "The final doom-emacs package";
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
default = self: [ ];
|
||||
type = hm.types.selectorFunction;
|
||||
defaultText = "epkgs: [ ]";
|
||||
example = literalExpression
|
||||
"epkgs: [ epkgs.vterm epkgs.treesit-grammars.with-all-grammars ]";
|
||||
description = ''
|
||||
Extra packages available to Doom Emacs.
|
||||
To let nix handle a doom dependency '(package! ...)' we can leverage the ':built-in t' argument
|
||||
Consider the following example for 'vterm' in the doom config packages.el:
|
||||
(package! vterm :built-in t)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(let
|
||||
doomPackages = doomFromPackages pkgs {
|
||||
inherit (cfg) emacs doomDir doomLocalDir profileName noProfileHack;
|
||||
inherit (cfg) emacs doomDir doomLocalDir profileName noProfileHack extraPackages;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue