nixos: systemd-tmpfiles: use cfg shorthand

This commit is contained in:
Bob van der Linden 2022-03-17 20:46:25 +01:00
parent 38d043de9c
commit 753b911708
No known key found for this signature in database
GPG key ID: EEBE8E3EC4A31364

View file

@ -1,6 +1,9 @@
{ config, lib, pkgs, utils, ... }:
with lib;
let
cfg = config.systemd.tmpfiles;
systemd = config.systemd.package;
in
{
@ -55,7 +58,7 @@ in
environment.etc = {
"tmpfiles.d".source = (pkgs.symlinkJoin {
name = "tmpfiles.d";
paths = map (p: p + "/lib/tmpfiles.d") config.systemd.tmpfiles.packages;
paths = map (p: p + "/lib/tmpfiles.d") cfg.packages;
postBuild = ''
for i in $(cat $pathsPath); do
(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.
# Please change the option systemd.tmpfiles.rules instead.
${concatStringsSep "\n" config.systemd.tmpfiles.rules}
${concatStringsSep "\n" cfg.rules}
'';
})
];