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 // {
|
minimalEmacs = (makeDoomPackages (common // {
|
||||||
doomDir = minimalDoomDir;
|
doomDir = minimalDoomDir;
|
||||||
})).emacsWithDoom;
|
})).emacsWithDoom;
|
||||||
|
minimalExtraPackages = mkDoom {
|
||||||
|
doomDir = minimalDoomDir;
|
||||||
|
extraPackages = epkgs: [ epkgs.vterm epkgs.treesit-grammars.with-all-grammars ];
|
||||||
|
};
|
||||||
allModules = mkDoom { doomDir = allModsDoomDir; };
|
allModules = mkDoom { doomDir = allModsDoomDir; };
|
||||||
allModulesAndFlags = mkDoom { doomDir = allFlagsDoomDir; };
|
allModulesAndFlags = mkDoom { doomDir = allFlagsDoomDir; };
|
||||||
example = mkDoom { doomDir = ./doomdir; };
|
example = mkDoom { doomDir = ./doomdir; };
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
noProfileHack ? false,
|
noProfileHack ? false,
|
||||||
/* Use fetchTree instead of fetchGit for package fetches. */
|
/* Use fetchTree instead of fetchGit for package fetches. */
|
||||||
experimentalFetchTree ? false,
|
experimentalFetchTree ? false,
|
||||||
|
/* Extra emacs packages from nixpkgs */
|
||||||
|
extraPackages ? epkgs: [ ],
|
||||||
|
|
||||||
callPackages,
|
callPackages,
|
||||||
git,
|
git,
|
||||||
|
|
@ -330,8 +332,8 @@ let
|
||||||
|
|
||||||
# Step 3: Build an emacsWithPackages, pulling all packages from step 1 from
|
# Step 3: Build an emacsWithPackages, pulling all packages from step 1 from
|
||||||
# the set from step 2.
|
# the set from step 2.
|
||||||
emacsWithPackages = doomEmacsPackages.emacsWithPackages
|
emacsWithPackages = doomEmacsPackages.emacsWithPackages
|
||||||
(epkgs: (map (p: epkgs.${p}) (builtins.attrNames doomPackageSet)));
|
(epkgs: (map (p: epkgs.${p}) (builtins.attrNames doomPackageSet)) ++ (extraPackages epkgs));
|
||||||
|
|
||||||
# Step 4: build a DOOMDIR, Doom profile and profile loader using Emacs from
|
# Step 4: build a DOOMDIR, Doom profile and profile loader using Emacs from
|
||||||
# step 3 and packages.el from step 1.
|
# step 3 and packages.el from step 1.
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.doom-emacs;
|
cfg = config.programs.doom-emacs;
|
||||||
inherit (lib) literalExpression mkEnableOption mkIf mkMerge mkOption types;
|
inherit (lib) literalExpression mkEnableOption mkIf mkMerge mkOption types hm;
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
programs.doom-emacs = {
|
programs.doom-emacs = {
|
||||||
|
|
@ -94,13 +94,27 @@ in {
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = "The final doom-emacs package";
|
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 [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(let
|
(let
|
||||||
doomPackages = doomFromPackages pkgs {
|
doomPackages = doomFromPackages pkgs {
|
||||||
inherit (cfg) emacs doomDir doomLocalDir profileName noProfileHack;
|
inherit (cfg) emacs doomDir doomLocalDir profileName noProfileHack extraPackages;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue