1
0
mirror of https://github.com/kmein/niveum synced 2026-03-22 04:41:07 +01:00

feat: split spotify config into spotifyd

This commit is contained in:
2020-10-28 20:29:01 +01:00
parent 59cacae72e
commit 048429f593
2 changed files with 7 additions and 13 deletions

32
configs/spotifyd.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs, lib, ... }:
let
inherit (lib.strings) fileContents;
in {
services.dbus.packages = [ pkgs.gnome3.dconf ];
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/audio/spotifyd.nix
systemd.user.services.spotifyd = let
spotifyd = pkgs.spotifyd.override {
withMpris = true;
withPulseAudio = true;
inherit (pkgs) libpulseaudio dbus;
};
spotifydConf = pkgs.writeText "spotifyd.conf" (lib.generators.toINI { } {
global = {
username = fileContents <secrets/spotify/username>;
password = fileContents <secrets/spotify/password>;
backend = "pulseaudio";
};
});
in {
wantedBy = [ "default.target" ];
after = [ "network-online.target" "sound.target" ];
description = "spotifyd, a Spotify playing daemon";
serviceConfig = {
ExecStart =
"${spotifyd}/bin/spotifyd --no-daemon --config-path ${spotifydConf}";
Restart = "always";
RestartSec = 12;
};
};
}