Skip to content

Commit

Permalink
nixos/systemd-tmpfiles: use types.attrsWith for settings (#363939)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliButz authored Dec 12, 2024
2 parents 0edcd80 + 2be50b1 commit 58df438
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nixos/modules/system/boot/systemd/tmpfiles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 58df438

Please sign in to comment.