1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-08 20:29:43 +01:00
home-manager/modules/programs/emacs.nix
2017-11-13 00:03:49 +01:00

42 lines
934 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: [];
defaultText = "epkgs: []";
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
description = "Extra packages available to Emacs.";
};
};
};
config = mkIf cfg.enable {
home.packages = [ (emacsWithPackages cfg.extraPackages) ];
};
}