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
2021-01-24 17:18:37 +01:00
committed by Silvan Mosberger
co-authored by Silvan Mosberger
parent 43243539b3
commit 8ac4b251c8
8 changed files with 8 additions and 0 deletions
@@ -25,6 +25,7 @@ in {
};
packages = mkOption {
type = types.functionTo (types.listOf types.package);
default = hp: [];
defaultText = "hp: []";
example = "hp: with hp; [ text lens ]";