feat: implement all (?) ci yaml keywords

This commit is contained in:
technofab 2025-09-25 14:49:46 +02:00
parent e752f71dd1
commit 0cca02f442
No known key found for this signature in database
3 changed files with 649 additions and 21 deletions

View file

@ -84,7 +84,7 @@ in rec {
unsetOr = typ:
(types.either unsetType typ)
// {
inherit (typ) description;
inherit (typ) description getSubOptions;
};
mkUnsetOption = opts:
mkOption (opts
@ -93,6 +93,14 @@ in rec {
default = opts.default or unset;
defaultText = literalExpression "unset";
});
eitherWithSubOptions = typ_one: typ_two:
(types.either typ_one typ_two)
// {
getSubOptions =
if (typ_one.getSubOptions "test" != {})
then typ_one.getSubOptions
else typ_two.getSubOptions;
};
filterUnset = value:
if builtins.isAttrs value && !builtins.hasAttr "_type" value