Merge pull request #102 from RossComputerGuy/fix/types

This commit is contained in:
Lassulus 2022-12-31 23:37:58 +01:00 committed by GitHub
commit 981160e9cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ rec {
# uses the field "type" to find the correct type in the attrset
subType = typeAttr: mkOptionType rec {
name = "subType";
description = "one of ${attrNames typeAttr}";
description = "one of ${concatStringsSep "," (attrNames typeAttr)}";
check = x: if x ? type then typeAttr.${x.type}.check x else throw "No type option set in:\n${generators.toPretty {} x}";
merge = loc: defs:
foldl' (res: def: typeAttr.${def.value.type}.merge loc [def]) {} defs;