emacs: allow custom Emacs package
This commit is contained in:
parent
e4deffcbe8
commit
76e0e09aca
|
@ -6,6 +6,10 @@ let
|
||||||
|
|
||||||
cfg = config.programs.emacs;
|
cfg = config.programs.emacs;
|
||||||
|
|
||||||
|
# Copied from all-packages.nix.
|
||||||
|
emacsPackages = pkgs.emacsPackagesNgGen cfg.package;
|
||||||
|
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -13,6 +17,14 @@ in
|
||||||
programs.emacs = {
|
programs.emacs = {
|
||||||
enable = mkEnableOption "Emacs";
|
enable = mkEnableOption "Emacs";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.emacs;
|
||||||
|
defaultText = "pkgs.emacs";
|
||||||
|
example = literalExample "pkgs.emacs25-nox";
|
||||||
|
description = "The Emacs package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
extraPackages = mkOption {
|
extraPackages = mkOption {
|
||||||
default = self: [];
|
default = self: [];
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
|
@ -24,6 +36,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ (pkgs.emacsWithPackages cfg.extraPackages) ];
|
home.packages = [ (emacsWithPackages cfg.extraPackages) ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue