Merge pull request #1209 from NotAShelf/notashelf/push-kuokzlukwzxp
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Treewide Checks / Validate flake (push) Has been cancelled
Treewide Checks / Check formatting (push) Has been cancelled
Treewide Checks / Check source tree for typos (push) Has been cancelled
Treewide Checks / Validate documentation builds (push) Has been cancelled
Treewide Checks / Validate hyperlinks in documentation sources (push) Has been cancelled
Treewide Checks / Validate Editorconfig conformance (push) Has been cancelled

lib: replace `type // { check = ...; }` with v2-compatible patterns
This commit is contained in:
raf 2025-11-02 17:25:57 +03:00 committed by GitHub
commit 20d8fca94d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 13 deletions

12
flake.lock generated
View file

@ -23,11 +23,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1759362264, "lastModified": 1760948891,
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=", "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "758cf7296bee11f1706a574c77d072b8a7baa881", "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -53,11 +53,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1759386674, "lastModified": 1761880412,
"narHash": "sha256-wg1Lz/1FC5Q13R+mM5a2oTV9TA9L/CHHTm3/PiLayfA=", "narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "625ad6366178f03acd79f9e3822606dd7985b657", "rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,13 +3,11 @@
inherit (lib.strings) isString stringLength match; inherit (lib.strings) isString stringLength match;
inherit (lib.types) listOf mkOptionType; inherit (lib.types) listOf mkOptionType;
in { in {
mergelessListOf = elemType: let mergelessListOf = elemType:
super = listOf elemType; mkOptionType {
in
super
// {
name = "mergelessListOf"; name = "mergelessListOf";
description = "mergeless ${super.description}"; description = "mergeless list of ${elemType.description or "values"}";
inherit (lib.types.listOf elemType) check;
merge = mergeEqualOption; merge = mergeEqualOption;
}; };

View file

@ -62,7 +62,13 @@ in rec {
inherit (elemType) getSubModules; inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]); getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
substSubModules = m: dagOf (elemType.substSubModules m); substSubModules = m: dagOf (elemType.substSubModules m);
functor = (defaultFunctor name) // {wrapped = elemType;}; functor = {
name = name;
type = dagOf;
wrapped = elemType;
payload = elemType;
binOp = a: b: a;
};
nestedTypes.elemType = elemType; nestedTypes.elemType = elemType;
}; };
} }