mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
initrd: emit a warning when tmpfiles config is created manually
This commit is contained in:
parent
d558554243
commit
6ccc6bf4d2
1 changed files with 14 additions and 0 deletions
|
@ -163,6 +163,20 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
warnings =
|
||||||
|
let
|
||||||
|
paths = lib.filter (path:
|
||||||
|
path != null && lib.hasPrefix "/etc/tmpfiles.d/" path
|
||||||
|
) (map (path: path.target) config.boot.initrd.systemd.storePaths);
|
||||||
|
in
|
||||||
|
lib.optional (lib.length paths > 0) (lib.concatStringsSep " " [
|
||||||
|
"Files inside /etc/tmpfiles.d in the initrd need to be created with"
|
||||||
|
"boot.initrd.systemd.tmpfiles.settings."
|
||||||
|
"Creating them by hand using boot.initrd.systemd.contents or"
|
||||||
|
"boot.initrd.systemd.storePaths will lead to errors in the future."
|
||||||
|
"Found these problematic files: ${lib.concatStringsSep ", " paths}"
|
||||||
|
]);
|
||||||
|
|
||||||
systemd.additionalUpstreamSystemUnits = [
|
systemd.additionalUpstreamSystemUnits = [
|
||||||
"systemd-tmpfiles-clean.service"
|
"systemd-tmpfiles-clean.service"
|
||||||
"systemd-tmpfiles-clean.timer"
|
"systemd-tmpfiles-clean.timer"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue