From 76e0e09aca244fdbe54a5604a1fa4f26ff5a051b Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 19 Sep 2017 23:32:01 +0200 Subject: [PATCH] emacs: allow custom Emacs package --- modules/programs/emacs.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 22a4ed43..35f03911 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -6,6 +6,10 @@ let cfg = config.programs.emacs; + # Copied from all-packages.nix. + emacsPackages = pkgs.emacsPackagesNgGen cfg.package; + emacsWithPackages = emacsPackages.emacsWithPackages; + in { @@ -13,6 +17,14 @@ in programs.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 { default = self: []; example = literalExample '' @@ -24,6 +36,6 @@ in }; config = mkIf cfg.enable { - home.packages = [ (pkgs.emacsWithPackages cfg.extraPackages) ]; + home.packages = [ (emacsWithPackages cfg.extraPackages) ]; }; }