mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 10:12:58 +00:00
352405c0f6
When using password_cmd, there's a 'file not found' error due to missing sh binary in path. For some reason, adding `path = [ "/bin" ]` doesn't fix the issue, but setting `SHELL` does. Related documentation: https://spotifyd.github.io/spotifyd/config/File.html#shell-used-to-run-commands-indicated-by-password_cmd-or-on_song_changed_hook----omit-in-toc---
44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.spotifyd;
|
|
spotifydConf = pkgs.writeText "spotifyd.conf" cfg.config;
|
|
in
|
|
{
|
|
options = {
|
|
services.spotifyd = {
|
|
enable = mkEnableOption "spotifyd, a Spotify playing daemon";
|
|
|
|
config = mkOption {
|
|
default = "";
|
|
type = types.lines;
|
|
description = ''
|
|
Configuration for Spotifyd. For syntax and directives, see
|
|
<link xlink:href="https://github.com/Spotifyd/spotifyd#Configuration"/>.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.services.spotifyd = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network-online.target" "sound.target" ];
|
|
description = "spotifyd, a Spotify playing daemon";
|
|
environment.SHELL = "/bin/sh";
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --cache-path /var/cache/spotifyd --config-path ${spotifydConf}";
|
|
Restart = "always";
|
|
RestartSec = 12;
|
|
DynamicUser = true;
|
|
CacheDirectory = "spotifyd";
|
|
SupplementaryGroups = ["audio"];
|
|
};
|
|
};
|
|
};
|
|
|
|
meta.maintainers = [ maintainers.anderslundstedt ];
|
|
}
|