mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixos/borgbackup: fix directory ownership regression
Re-add separate creation of the ~/.config and ~/.cache directories so
that they get correct ownership. Or else they get owned by root.
systemd-tmpfiles also warns about it:
machine # [ 3.022195] systemd-tmpfiles[472]: Detected unsafe path transition /home/user1 (owned by user1) → /home/user1/.cache (owned by root) during canonicalization of home/user1/.cache.
machine # [ 3.024566] systemd-tmpfiles[472]: Detected unsafe path transition /home/user1 (owned by user1) → /home/user1/.config (owned by root) during canonicalization of home/user1/.config.
Fixes: 8d3cf213db
("nixos/borgbackup: replace activationScript via tmpfiles")
This commit is contained in:
parent
9c926d3de2
commit
786141228f
@ -147,6 +147,9 @@ let
|
||||
let
|
||||
settings = { inherit (cfg) user group; };
|
||||
in lib.nameValuePair "borgbackup-job-${name}" ({
|
||||
# Create parent dirs separately, to ensure correct ownership.
|
||||
"${config.users.users."${cfg.user}".home}/.config".d = settings;
|
||||
"${config.users.users."${cfg.user}".home}/.cache".d = settings;
|
||||
"${config.users.users."${cfg.user}".home}/.config/borg".d = settings;
|
||||
"${config.users.users."${cfg.user}".home}/.cache/borg".d = settings;
|
||||
} // optionalAttrs (isLocalPath cfg.repo && !cfg.removableDevice) {
|
||||
|
Loading…
Reference in New Issue
Block a user