this post was submitted on 21 Apr 2024
14 points (100.0% liked)
Nix / NixOS
1765 readers
4 users here now
Main links
Videos
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I use/abuse "systemd.user.tmpfiles.rules" to ensure important files and folders are present with the desired permissions. These are "for creation, deletion and cleaning of volatile and temporary files automatically", but from what I can tell, if you don't specify values for cleanup etc. then they are just created if they don't exist, permissions adjusted if they do and they are otherwise left alone. See the manpage tmpfiles.d(5) for the exact format.
The config looks something like this:
where username and groupname are replaced with the actual values for the user being home-managed.