3
0
Fork 0
forked from mirrors/nixpkgs

nixos/hqplayerd: set HOME to path in state directory

The service likes to write files uploaded by the user to the service
user's $HOME. In our case the hqplayerd user has no home directory,
since it's a system user, and regardless we'd like to keep the service's
state contained.

With this change the unit forces HOME to point to
/var/lib/hqplayer/home, which works around the issue.
This commit is contained in:
Bernardo Meurer 2021-08-03 23:29:31 -07:00
parent 5e1e2914eb
commit f949ce7449
No known key found for this signature in database
GPG key ID: F4C0D53B8D14C246

View file

@ -102,6 +102,7 @@ in
tmpfiles.rules = [
"d ${configDir} 0755 ${cfg.user} ${cfg.group} - -"
"d ${stateDir} 0755 ${cfg.user} ${cfg.group} - -"
"d ${stateDir}/home 0755 ${cfg.user} ${cfg.group} - -"
];
services.hqplayerd = {
@ -110,6 +111,8 @@ in
requires = [ "network-online.target" "sound.target" "systemd-udev-settle.service" ];
after = [ "network-online.target" "sound.target" "systemd-udev-settle.service" "local-fs.target" "remote-fs.target" "systemd-tmpfiles-setup.service" ];
environment.HOME = "${stateDir}/home";
unitConfig.ConditionPathExists = [ configDir stateDir ];
preStart =