nixos/hqplayerd: don't add config to restartTriggers when it doesn't exist

Previously when the use didn't set `hqplayer.config`, we would still
attempt to reference the config file in the restartTriggers, causing an
error.
This commit is contained in:
Bernardo Meurer 2021-08-13 15:16:21 -07:00
parent 196138ea6b
commit c934bb6771
No known key found for this signature in database
GPG key ID: F4C0D53B8D14C246

View file

@ -110,7 +110,7 @@ in
unitConfig.ConditionPathExists = [ configDir stateDir ];
restartTriggers = [ config.environment.etc."hqplayer/hqplayerd.xml".source ];
restartTriggers = optionals (cfg.config != null) [ config.environment.etc."hqplayer/hqplayerd.xml".source ];
preStart = ''
cp -r "${pkg}/var/lib/hqplayer/web" "${stateDir}"