1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-09 12:49:44 +01:00
home-manager/modules/programs/emacs.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

2017-01-07 19:16:26 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.emacs;
2017-09-19 23:32:01 +02:00
# Copied from all-packages.nix.
emacsPackages = pkgs.emacsPackagesNgGen cfg.package;
emacsWithPackages = emacsPackages.emacsWithPackages;
2017-01-07 19:16:26 +01:00
in
{
meta.maintainers = [ maintainers.rycee ];
2017-01-07 19:16:26 +01:00
options = {
programs.emacs = {
enable = mkEnableOption "Emacs";
2017-09-19 23:32:01 +02:00
package = mkOption {
type = types.package;
default = pkgs.emacs;
defaultText = "pkgs.emacs";
example = literalExample "pkgs.emacs25-nox";
description = "The Emacs package to use.";
};
2017-01-07 19:16:26 +01:00
extraPackages = mkOption {
default = self: [];
defaultText = "epkgs: []";
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
2017-01-07 19:16:26 +01:00
description = "Extra packages available to Emacs.";
};
finalPackage = mkOption {
type = types.package;
internal = true;
readOnly = true;
description = "The Emacs package including any extra packages.";
};
2017-01-07 19:16:26 +01:00
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.finalPackage ];
programs.emacs.finalPackage = emacsWithPackages cfg.extraPackages;
2017-01-07 19:16:26 +01:00
};
}