mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 20:02:14 +03:00
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:
parent
5e1e2914eb
commit
f949ce7449
@ -100,8 +100,9 @@ in
|
||||
|
||||
systemd = {
|
||||
tmpfiles.rules = [
|
||||
"d ${configDir} 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d ${stateDir} 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"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 =
|
||||
|
Loading…
Reference in New Issue
Block a user