chore: build utility functions

This commit is contained in:
transcaffeine 2024-12-03 20:20:09 +01:00
parent e5aef16a97
commit bd46837713
Signed by: transcaffeine
GPG Key ID: 03624C433676E465

14
utils/default.nix Normal file
View File

@ -0,0 +1,14 @@
{ lib, ...}:
rec {
_tupleToEntry = x: x.name + (if lib.isBool x.value then "" else (" " + x.value));
attrsToConfig = attrs: (
lib.concatStringsSep "\n" (
map (_tupleToEntry) (
builtins.filter (e: e.value != false) (
lib.attrsToList attrs
)
)
)
);
}