mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
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.
This commit is contained in:
parent
6b37f91a86
commit
2be50b1efe
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue