mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
feat(lib): add moduleToAttrs method
This commit is contained in:
parent
b96611bef4
commit
e345605e79
1 changed files with 9 additions and 0 deletions
9
lib.nix
9
lib.nix
|
|
@ -4,6 +4,15 @@ with lib;
|
|||
|
||||
let
|
||||
in rec {
|
||||
moduleToAttrs = value:
|
||||
if isAttrs value
|
||||
then mapAttrs (n: v: moduleToAttrs v) (filterAttrs (n: v: !(hasPrefix "_" n) && v != null) value)
|
||||
|
||||
else if isList value
|
||||
then map (v: moduleToAttrs v) value
|
||||
|
||||
else value;
|
||||
|
||||
mkOptionDefault = mkOverride 1001;
|
||||
|
||||
mkAllDefault = value: priority:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue