1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-05 10:49:44 +01:00
home-manager/modules/programs/emacs.nix
2017-09-26 23:40:31 +02:00

43 lines
921 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.emacs;
# Copied from all-packages.nix.
emacsPackages = pkgs.emacsPackagesNgGen cfg.package;
emacsWithPackages = emacsPackages.emacsWithPackages;
in
{
meta.maintainers = [ maintainers.rycee ];
options = {
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 ''
epkgs: [ epkgs.emms epkgs.magit ]
'';
description = "Extra packages available to Emacs.";
};
};
};
config = mkIf cfg.enable {
home.packages = [ (emacsWithPackages cfg.extraPackages) ];
};
}