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 { packages = mkOption {
type = types.functionTo (types.listOf types.package);
default = hp: []; default = hp: [];
defaultText = "hp: []"; defaultText = "hp: []";
example = "hp: with hp; [ text lens ]"; example = "hp: with hp; [ text lens ]";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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