emacs: fix merging of extraPackages and overrides

Because `extraPackages` and `overrides` expect functions as values it
has not been possible to perform merges. This adds suitable types for
these options that allow reasonable merging.
This commit is contained in:
Jonas Holst Damtoft 2018-12-29 21:21:11 +01:00 committed by Robert Helgesson
parent 42732990cd
commit cf0aad391c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 32 additions and 0 deletions

View file

@ -4,6 +4,8 @@ with lib;
let
hmTypes = import ../lib/types.nix { inherit lib; };
cfg = config.programs.emacs;
# Copied from all-packages.nix, with modifications to support
@ -34,6 +36,7 @@ in
extraPackages = mkOption {
default = self: [];
type = hmTypes.selectorFunction;
defaultText = "epkgs: []";
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
description = "Extra packages available to Emacs.";
@ -41,6 +44,7 @@ in
overrides = mkOption {
default = self: super: {};
type = hmTypes.overlayFunction;
defaultText = "self: super: {}";
example = literalExample ''
self: super: rec {