As the title says, I’m linking in a file with
xdg.configFile, and need to be able to set permissions on it. How do I do this?
The reasoning here is it’s the accounts file for aerc, which complains if the permissions are too lax (although I’m not storing passwords within).
Just discovered you can disable aerc’s check with
unsafe-accounts-conf=true, but I’d still like to know how to set the permissions.
Maybe what you want is systemd.tmpfiles.rules. Also see systemd tmpfiles - ArchWiki. The syntax is described in man tmpfiles.d.
Example from my config
systemd.tmpfiles.rules = [
# enable cache mountpoint for shared access like `/tmp`
"d! /var/cache 1777 root root - -"
"d! /keep/etc 0770 root eric - -"
"d! /keep/etc/nixos 0770 eric eric - -"
"d! /keep/etc/NetworkManager 0770 root eric - -"
"d! /keep/etc/NetworkManager/system-connections 0770 root root - -"
"L+! /etc/NetworkManager/system-connections/ - - - - /keep/etc/NetworkManager/system-connections/"
Permissions of files in the nix store are always 555 or 444, and home-manager doesn’t provide the option to copy the files with different permissions (like nixos’
You could use activation snippets or a systemd oneshot service to run a copy operation, if you really needed specific permissions on a declaratively set-up file.
Apologies for the delayed reply, I missed the notifications somehow.
Thanks for the responses. Out of curiosity, is there a reason this is not currently implemented in home-manager or is it just not something people are asking for?