nixos: use functionTo to prevent evaluation errors while merging

Without this patch merging options like
services.xserver.windowManager.xmonad.extraPackages
results in the evaluation error:

  error: value is a list while a set was expected, at nixpkgs/lib/options.nix:77:23

With this patch we get the desired merging behaviour that just concatenates the
resulting package lists.

(cherry picked from commit 6e99f9fdecb1f28308c8e0aed0fc851737354864)

Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
This commit is contained in:
Bas van Dijk 2018-08-07 18:53:56 +02:00 committed by Silvan Mosberger
parent 43243539b3
commit 8ac4b251c8
No known key found for this signature in database
GPG key ID: E8F1E9EAD284E17D
8 changed files with 8 additions and 0 deletions

View file

@ -25,6 +25,7 @@ in {
};
packages = mkOption {
type = types.functionTo (types.listOf types.package);
default = hp: [];
defaultText = "hp: []";
example = "hp: with hp; [ text lens ]";

View file

@ -42,6 +42,7 @@ let
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = self: [];
example = literalExample ''
haskellPackages: [

View file

@ -21,6 +21,7 @@ in
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = self: [];
example = literalExample ''
haskellPackages: [

View file

@ -66,6 +66,7 @@ in
};
plugins = mkOption {
type = types.functionTo (types.listOf types.package);
default = plugins: [];
defaultText = "plugins: []";
example = literalExample "plugins: with plugins; [ themeify stlviewer ]";

View file

@ -77,6 +77,7 @@ in {
'';
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = ps: [];
defaultText = "ps: []";
example = literalExample ''

View file

@ -64,6 +64,7 @@ in
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = p: [];
description = ''
Extra Python packages available to supybot plugins. The

View file

@ -37,6 +37,7 @@ in
description = "Enable an uncustomised exwm configuration.";
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = self: [];
example = literalExample ''
epkgs: [

View file

@ -53,6 +53,7 @@ in {
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = self: [];
defaultText = "self: []";
example = literalExample ''