nixos: systemd-tmpfiles: use cfg shorthand
This commit is contained in:
parent
38d043de9c
commit
753b911708
|
@ -1,6 +1,9 @@
|
||||||
{ config, lib, pkgs, utils, ... }:
|
{ config, lib, pkgs, utils, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
cfg = config.systemd.tmpfiles;
|
||||||
systemd = config.systemd.package;
|
systemd = config.systemd.package;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -55,7 +58,7 @@ in
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
"tmpfiles.d".source = (pkgs.symlinkJoin {
|
"tmpfiles.d".source = (pkgs.symlinkJoin {
|
||||||
name = "tmpfiles.d";
|
name = "tmpfiles.d";
|
||||||
paths = map (p: p + "/lib/tmpfiles.d") config.systemd.tmpfiles.packages;
|
paths = map (p: p + "/lib/tmpfiles.d") cfg.packages;
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
for i in $(cat $pathsPath); do
|
for i in $(cat $pathsPath); do
|
||||||
(test -d "$i" && test $(ls "$i"/*.conf | wc -l) -ge 1) || (
|
(test -d "$i" && test $(ls "$i"/*.conf | wc -l) -ge 1) || (
|
||||||
|
@ -94,7 +97,7 @@ in
|
||||||
# This file is created automatically and should not be modified.
|
# This file is created automatically and should not be modified.
|
||||||
# Please change the option ‘systemd.tmpfiles.rules’ instead.
|
# Please change the option ‘systemd.tmpfiles.rules’ instead.
|
||||||
|
|
||||||
${concatStringsSep "\n" config.systemd.tmpfiles.rules}
|
${concatStringsSep "\n" cfg.rules}
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue