diff --git a/lib/types.nix b/lib/types.nix
index 2590d3e8710b3..9e6cc1768adc3 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -163,7 +163,7 @@ rec {
# When adding new types don't forget to document them in
- # nixos/doc/manual/development/option-types.xml!
+ # nixos/doc/manual/development/option-types.section.md!
types = rec {
raw = mkOptionType rec {
@@ -395,10 +395,12 @@ rec {
merge = mergeEqualOption;
};
- listOf = elemType: mkOptionType rec {
+ # NixOS apparently has a different notion of "type" than nix(lang)
+ # does; see discussion in GH #173568
+ listOfGeneralized = isNixOS: elemType: mkOptionType rec {
name = "listOf";
- description = "list of ${elemType.description}";
- check = isList;
+ description = "list of ${elemType.description}s";
+ check = v: isList v && (isNixOS || all elemType.check v);
merge = loc: defs:
map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
imap1 (m: def':
@@ -417,6 +419,9 @@ rec {
nestedTypes.elemType = elemType;
};
+ listOf = listOfGeneralized true;
+ listOf' = listOfGeneralized false;
+
nonEmptyListOf = elemType:
let list = addCheck (types.listOf elemType) (l: l != []);
in list // {
diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md
index 00f1d85bdb615..fc8f05b48e9ca 100644
--- a/nixos/doc/manual/development/option-types.section.md
+++ b/nixos/doc/manual/development/option-types.section.md
@@ -227,8 +227,14 @@ Composed types are types that take a type as parameter. `listOf
`types.listOf` *`t`*
-: A list of *`t`* type, e.g. `types.listOf
- int`. Multiple definitions are merged with list concatenation.
+: A list, probably but not certainly of *`t`* type, e.g. `types.listOf
+ int`. Multiple definitions are merged with list concatenation. The
+ `check` method will not examine the types of the list elements.
+
+`types.listOf'` *`t`*
+
+: A list of *`t`* type, e.g. `types.listOf' int`. Multiple definitions
+ are merged with list concatenation.
`types.attrsOf` *`t`*
diff --git a/nixos/doc/manual/from_md/development/option-types.section.xml b/nixos/doc/manual/from_md/development/option-types.section.xml
index 4447292927021..5243759eb4ff0 100644
--- a/nixos/doc/manual/from_md/development/option-types.section.xml
+++ b/nixos/doc/manual/from_md/development/option-types.section.xml
@@ -442,10 +442,26 @@
types.listOf
t
+
+
+ A list, probably but not certainly of
+ t type, e.g.
+ types.listOf int. Multiple definitions
+ are merged with list concatenation. The
+ check method will not examine the types
+ of the list elements.
+
+
+
+
+
+ types.listOf'
+ t
+
A list of t type,
- e.g. types.listOf int. Multiple
+ e.g. types.listOf' int. Multiple
definitions are merged with list concatenation.
diff --git a/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix b/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix
index 780de142c5fd7..d7a80a595495e 100644
--- a/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix
+++ b/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix
@@ -17,7 +17,7 @@ let
homepage = "https://keepass.info/plugins.html#otpkeyprov";
platforms = with lib.platforms; linux;
license = lib.licenses.gpl2;
- maintainers = [ lib.maintainers.ente ];
+ maintainers = [ /*lib.maintainers.ente*/ ];
};
pluginFilename = "OtpKeyProv.plgx";
diff --git a/pkgs/applications/window-managers/sway/contrib.nix b/pkgs/applications/window-managers/sway/contrib.nix
index a221eb7a8e65b..5c0c4ade0c377 100644
--- a/pkgs/applications/window-managers/sway/contrib.nix
+++ b/pkgs/applications/window-managers/sway/contrib.nix
@@ -62,8 +62,8 @@ grimshot = stdenv.mkDerivation rec {
homepage = "https://github.com/swaywm/sway/tree/master/contrib";
license = licenses.mit;
platforms = platforms.all;
- maintainers = with maintainers; [
- sway-unwrapped.meta.maintainers
+ maintainers = with maintainers;
+ sway-unwrapped.meta.maintainers ++ [
evils
];
};
diff --git a/pkgs/development/tools/parsing/javacc/default.nix b/pkgs/development/tools/parsing/javacc/default.nix
index d074e3dda93e6..a3adad076cf06 100644
--- a/pkgs/development/tools/parsing/javacc/default.nix
+++ b/pkgs/development/tools/parsing/javacc/default.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation rec {
homepage = "https://javacc.github.io/javacc";
description = "A parser generator for building parsers from grammars";
license = licenses.bsd2;
- maintainers = [ teams.deshaw.members ];
+ maintainers = teams.deshaw.members;
};
}
diff --git a/pkgs/games/quake3/quake3e/default.nix b/pkgs/games/quake3/quake3e/default.nix
index 2346e6022d94f..c32cf153c4f6a 100644
--- a/pkgs/games/quake3/quake3e/default.nix
+++ b/pkgs/games/quake3/quake3e/default.nix
@@ -47,6 +47,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ pmiddend ];
- badPlatforms = [ platforms.aarch64 ];
+ badPlatforms = platforms.aarch64;
};
}
diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix
index cb46b63dd0c49..13bd31d6f9748 100644
--- a/pkgs/pkgs-lib/formats.nix
+++ b/pkgs/pkgs-lib/formats.nix
@@ -44,7 +44,7 @@ rec {
str
path
(attrsOf valueType)
- (listOf valueType)
+ (listOf' valueType)
]) // {
description = "JSON value";
};
@@ -78,7 +78,7 @@ rec {
str
path
(attrsOf valueType)
- (listOf valueType)
+ (listOf' valueType)
]) // {
description = "YAML value";
};
@@ -110,7 +110,7 @@ rec {
iniAtom =
if listsAsDuplicateKeys then
- coercedTo singleIniAtom lib.singleton (listOf singleIniAtom) // {
+ coercedTo singleIniAtom lib.singleton (listOf' singleIniAtom) // {
description = singleIniAtom.description + " or a list of them for duplicate keys";
}
else if listToValue != null then
@@ -155,7 +155,7 @@ rec {
str
path
(attrsOf valueType)
- (listOf valueType)
+ (listOf' valueType)
] // {
description = "TOML value";
};
@@ -269,7 +269,7 @@ rec {
float
str
(attrsOf valueType)
- (listOf valueType)
+ (listOf' valueType)
]) // {
description = "Elixir value";
};
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix
index 1da098dabbee1..217de4b858249 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -222,14 +222,14 @@ let
mainProgram = str;
longDescription = str;
branch = str;
- homepage = either (listOf str) str;
+ homepage = either (listOf' str) str;
downloadPage = str;
- changelog = either (listOf str) str;
- license = either (listOf lib.types.attrs) (either lib.types.attrs str);
- maintainers = listOf (attrsOf str);
+ changelog = either (listOf' str) str;
+ license = let license = either lib.types.attrs str; in either license (listOf' license);
+ maintainers = listOf' (attrsOf str);
priority = int;
- platforms = listOf str;
- hydraPlatforms = listOf str;
+ platforms = listOf' str;
+ hydraPlatforms = listOf' str;
broken = bool;
unfree = bool;
unsupported = bool;
@@ -248,12 +248,12 @@ let
# Weirder stuff that doesn't appear in the documentation?
maxSilent = int;
- knownVulnerabilities = listOf str;
+ knownVulnerabilities = listOf' str;
name = str;
version = str;
tag = str;
- executables = listOf str;
- outputsToInstall = listOf str;
+ executables = listOf' str;
+ outputsToInstall = listOf' str;
position = str;
available = bool;
isBuildPythonPackage = platforms;
diff --git a/pkgs/tools/security/ghidra/build.nix b/pkgs/tools/security/ghidra/build.nix
index bb53a1958e000..e4f87d06e5308 100644
--- a/pkgs/tools/security/ghidra/build.nix
+++ b/pkgs/tools/security/ghidra/build.nix
@@ -172,7 +172,7 @@ in stdenv.mkDerivation rec {
homepage = "https://ghidra-sre.org/";
platforms = [ "x86_64-linux" "x86_64-darwin" ];
license = licenses.asl20;
- maintainers = [ "roblabla" ];
+ maintainers = with maintainers; [ roblabla ];
};
}
diff --git a/pkgs/tools/security/onlykey-agent/default.nix b/pkgs/tools/security/onlykey-agent/default.nix
index 84c65b913458a..05d1e7ca37e8e 100644
--- a/pkgs/tools/security/onlykey-agent/default.nix
+++ b/pkgs/tools/security/onlykey-agent/default.nix
@@ -26,7 +26,7 @@ let
meta = oa.meta // {
description = "Using OnlyKey as hardware SSH and GPG agent";
homepage = "https://github.com/trustcrypto/onlykey-agent/tree/ledger";
- maintainers = with maintainers; [ kalbasit ];
+ maintainers = with lib.maintainers; [ kalbasit ];
};
});
in
diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix
index 8c15e63e5fb1d..4a06dedb9ca4a 100644
--- a/pkgs/top-level/config.nix
+++ b/pkgs/top-level/config.nix
@@ -21,7 +21,7 @@ let
/* Internal stuff */
warnings = mkOption {
- type = types.listOf types.str;
+ type = types.listOf' types.str;
default = [];
internal = true;
};
@@ -99,7 +99,7 @@ let
};
showDerivationWarnings = mkOption {
- type = types.listOf (types.enum [ "maintainerless" ]);
+ type = types.listOf' (types.enum [ "maintainerless" ]);
default = [];
description = ''
Which warnings to display for potentially dangerous