mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-08 03:26:08 +03:00
nixos: systemd-tmpfiles: use cfg shorthand
This commit is contained in:
parent
38d043de9c
commit
753b911708
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue