mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[General/Cleanup] Simplify nixConfig generator
This commit is contained in:
parent
825a3d5b65
commit
0e0ebc1502
1 changed files with 5 additions and 4 deletions
|
|
@ -9,16 +9,17 @@ let
|
|||
else if isList value then toString value
|
||||
else generators.mkValueStringDefault { } value;
|
||||
|
||||
isNullOrEmpty = v: (v == null) ||
|
||||
(isList v && (length v == 0));
|
||||
|
||||
nixConfig = settings: (generators.toKeyValue {
|
||||
mkKeyValue = generators.mkKeyValueDefault {
|
||||
mkValueString = nixConfigValue;
|
||||
} " = ";
|
||||
} (filterAttrs (n: v: !(
|
||||
(v == null) ||
|
||||
(isList v && (length v == 0))
|
||||
))
|
||||
} (filterAttrs (n: v: !(isNullOrEmpty v))
|
||||
settings)
|
||||
);
|
||||
|
||||
in
|
||||
{
|
||||
options.aviallon.general = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue