fix: typo unwrapRes -> unwrapOk
This commit is contained in:
parent
08ceff4581
commit
143a63e81e
1 changed files with 7 additions and 5 deletions
12
flake.nix
12
flake.nix
|
|
@ -110,21 +110,23 @@
|
||||||
Cerulean Nexus nodes must be provided as an attribute set, got "${builtins.typeOf nodeAttrs}" instead!
|
Cerulean Nexus nodes must be provided as an attribute set, got "${builtins.typeOf nodeAttrs}" instead!
|
||||||
Ensure all `cerulean.nexus.nodes.${name}` declarations are attribute sets under your call to `cerulean.mkNexus`.
|
Ensure all `cerulean.nexus.nodes.${name}` declarations are attribute sets under your call to `cerulean.mkNexus`.
|
||||||
''
|
''
|
||||||
# TODO: nodeAttrs.system won't display any nice error messages!!
|
|
||||||
# TODO: will mergeTypedStruct give nice error messages? or should I use mergeStructErr directly?
|
|
||||||
else let
|
else let
|
||||||
templateAttrs = templateNode name nodeAttrs.system;
|
templateAttrs = templateNode name nodeAttrs.system;
|
||||||
S = nib.parse.parseStructFor templateAttrs nodeAttrs;
|
S = nib.parse.parseStructFor templateAttrs nodeAttrs;
|
||||||
in
|
in
|
||||||
nib.types.unwrapRes (_:
|
nib.types.unwrapOk (_:
|
||||||
abort ''
|
abort ''
|
||||||
Cerulean failed to parse `cerulean.nexus.nodes.${name}`!
|
Cerulean failed to parse `cerulean.nexus.nodes.${name}`!
|
||||||
mergeStruct should never return `result.Err`... How are you here?!?
|
mergeStruct should never return `result.Err`... How are you here?!?
|
||||||
'')
|
'')
|
||||||
S;
|
S;
|
||||||
|
|
||||||
# TODO: mapNodes = f: mapAttrs (name: nodeAttrs: f name (parseNode name nodeAttrs)) config.nexus.nodes
|
# mapNodes = f: builtins.mapAttrs f (builtins.mapAttrs parseNode config.nexus.nodes);
|
||||||
mapNodes = f: builtins.mapAttrs f (builtins.mapAttrs parseNode config.nexus.nodes);
|
mapNodes = f:
|
||||||
|
builtins.mapAttrs (
|
||||||
|
name: nodeAttrs: f name (parseNode name nodeAttrs)
|
||||||
|
)
|
||||||
|
config.nexus.nodes;
|
||||||
in rec {
|
in rec {
|
||||||
nixosConfigurations = mapNodes (
|
nixosConfigurations = mapNodes (
|
||||||
_: node:
|
_: node:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue