feat: Polyfill attrsWith
This restores support for a range EOL versions, which may occasionally be of interest for testing, bisections, etc.
This commit is contained in:
parent
0bdadb1b26
commit
eb0b4983a2
1 changed files with 6 additions and 1 deletions
7
lib.nix
7
lib.nix
|
|
@ -165,6 +165,11 @@ let
|
||||||
};
|
};
|
||||||
mkPerSystemOption = mkDeferredModuleOption;
|
mkPerSystemOption = mkDeferredModuleOption;
|
||||||
|
|
||||||
|
# Polyfill https://github.com/NixOS/nixpkgs/pull/344216
|
||||||
|
# Nixpkgs master 2024-12-09, Nixpkgs 25.05
|
||||||
|
attrsWith = types.attrsWith or ({ elemType, lazy ? false, placeholder ? "name" }:
|
||||||
|
if lazy then types.attrsOf elemType else types.lazyAttrsOf elemType);
|
||||||
|
|
||||||
# Helper function for defining a per-system option that
|
# Helper function for defining a per-system option that
|
||||||
# gets transposed by the usual flake system logic to a
|
# gets transposed by the usual flake system logic to a
|
||||||
# top-level flake attribute.
|
# top-level flake attribute.
|
||||||
|
|
@ -174,7 +179,7 @@ let
|
||||||
options = {
|
options = {
|
||||||
flake = flake-parts-lib.mkSubmoduleOptions {
|
flake = flake-parts-lib.mkSubmoduleOptions {
|
||||||
${name} = mkOption {
|
${name} = mkOption {
|
||||||
type = types.attrsWith {
|
type = attrsWith {
|
||||||
elemType = option.type;
|
elemType = option.type;
|
||||||
lazy = true;
|
lazy = true;
|
||||||
placeholder = "system";
|
placeholder = "system";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue