nixos/spotifyd: init
This commit is contained in:
parent
e6dd87c438
commit
53841fcea9
@ -198,6 +198,7 @@
|
|||||||
./services/audio/slimserver.nix
|
./services/audio/slimserver.nix
|
||||||
./services/audio/snapserver.nix
|
./services/audio/snapserver.nix
|
||||||
./services/audio/squeezelite.nix
|
./services/audio/squeezelite.nix
|
||||||
|
./services/audio/spotifyd.nix
|
||||||
./services/audio/ympd.nix
|
./services/audio/ympd.nix
|
||||||
./services/backup/automysqlbackup.nix
|
./services/backup/automysqlbackup.nix
|
||||||
./services/backup/bacula.nix
|
./services/backup/bacula.nix
|
||||||
|
42
nixos/modules/services/audio/spotifyd.nix
Normal file
42
nixos/modules/services/audio/spotifyd.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{ 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
|
||||||
|
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";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --cache_path /var/cache/spotifyd --config ${spotifydConf}";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 12;
|
||||||
|
DynamicUser = true;
|
||||||
|
CacheDirectory = "spotifyd";
|
||||||
|
SupplementaryGroups = ["audio"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = [ maintainers.anderslundstedt ];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user