mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +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 if isList value then toString value
|
||||||
else generators.mkValueStringDefault { } value;
|
else generators.mkValueStringDefault { } value;
|
||||||
|
|
||||||
|
isNullOrEmpty = v: (v == null) ||
|
||||||
|
(isList v && (length v == 0));
|
||||||
|
|
||||||
nixConfig = settings: (generators.toKeyValue {
|
nixConfig = settings: (generators.toKeyValue {
|
||||||
mkKeyValue = generators.mkKeyValueDefault {
|
mkKeyValue = generators.mkKeyValueDefault {
|
||||||
mkValueString = nixConfigValue;
|
mkValueString = nixConfigValue;
|
||||||
} " = ";
|
} " = ";
|
||||||
} (filterAttrs (n: v: !(
|
} (filterAttrs (n: v: !(isNullOrEmpty v))
|
||||||
(v == null) ||
|
|
||||||
(isList v && (length v == 0))
|
|
||||||
))
|
|
||||||
settings)
|
settings)
|
||||||
);
|
);
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.aviallon.general = {
|
options.aviallon.general = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue