forked from Fediversity/Fediversity
use mapAttrs
right
`mapAttrs'` takes two args rather than a set, whereas if only the val changes `mapAttrs (_: v: ...)` should do
This commit is contained in:
parent
4880766c59
commit
222fca8249
1 changed files with 2 additions and 8 deletions
|
@ -20,11 +20,7 @@ let
|
||||||
options.resources = mkOption {
|
options.resources = mkOption {
|
||||||
# TODO: maybe transpose, and group the resources by type instead
|
# TODO: maybe transpose, and group the resources by type instead
|
||||||
type = attrsOf (
|
type = attrsOf (
|
||||||
attrTag (
|
attrTag (lib.mapAttrs (_name: resource: mkOption { type = resource.request; }) config.resources)
|
||||||
lib.mapAttrs' (name: resource: {
|
|
||||||
${name} = mkOption { type = resource.request; };
|
|
||||||
}) config.resources
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -118,9 +114,7 @@ in
|
||||||
# TODO: maybe transpose, and group the resources by type instead
|
# TODO: maybe transpose, and group the resources by type instead
|
||||||
type = attrsOf (
|
type = attrsOf (
|
||||||
attrTag (
|
attrTag (
|
||||||
lib.mapAttrs' (name: resource: {
|
lib.mapAttrs (_name: resource: mkOption { type = submodule resource.policy; }) config.resources
|
||||||
${name} = mkOption { type = resource.policy; };
|
|
||||||
}) config.resources
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue