2017-01-07 18:16:26 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.emacs;
|
|
|
|
|
2017-09-19 21:32:01 +00:00
|
|
|
# Copied from all-packages.nix.
|
|
|
|
emacsPackages = pkgs.emacsPackagesNgGen cfg.package;
|
|
|
|
emacsWithPackages = emacsPackages.emacsWithPackages;
|
|
|
|
|
2017-01-07 18:16:26 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2017-09-26 21:40:31 +00:00
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
2017-01-07 18:16:26 +00:00
|
|
|
options = {
|
|
|
|
programs.emacs = {
|
|
|
|
enable = mkEnableOption "Emacs";
|
|
|
|
|
2017-09-19 21:32:01 +00: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 18:16:26 +00:00
|
|
|
extraPackages = mkOption {
|
|
|
|
default = self: [];
|
2017-11-12 23:03:49 +00:00
|
|
|
defaultText = "epkgs: []";
|
|
|
|
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
|
2017-01-07 18:16:26 +00:00
|
|
|
description = "Extra packages available to Emacs.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2017-09-19 21:32:01 +00:00
|
|
|
home.packages = [ (emacsWithPackages cfg.extraPackages) ];
|
2017-01-07 18:16:26 +00:00
|
|
|
};
|
|
|
|
}
|