From 2be50b1efee6a94bbc7397f1818468fd29f72ced Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 10 Dec 2024 15:48:34 +0100 Subject: [PATCH] nixos/systemd-tmpfiles: use `types.attrsWith` for `settings` That way it's way easier to derive from the manual which key is used for what exactly. --- nixos/modules/system/boot/systemd/tmpfiles.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd/tmpfiles.nix b/nixos/modules/system/boot/systemd/tmpfiles.nix index 9a0f18c26f94..10d58dc0c706 100644 --- a/nixos/modules/system/boot/systemd/tmpfiles.nix +++ b/nixos/modules/system/boot/systemd/tmpfiles.nix @@ -7,6 +7,10 @@ let initrdCfg = config.boot.initrd.systemd.tmpfiles; systemd = config.systemd.package; + attrsWith' = placeholder: elemType: types.attrsWith { + inherit elemType placeholder; + }; + settingsOption = { description = '' Declare systemd-tmpfiles rules to create, delete, and clean up volatile @@ -25,7 +29,7 @@ let }; }; default = {}; - type = types.attrsOf (types.attrsOf (types.attrsOf (types.submodule ({ name, config, ... }: { + type = attrsWith' "config-name" (attrsWith' "tmpfiles-type" (attrsWith' "path" (types.submodule ({ name, config, ... }: { options.type = mkOption { type = types.str; default = name;