From a7f18eab61eef74044c2113f275ffad5900e82b7 Mon Sep 17 00:00:00 2001 From: Annika Merris Date: Sun, 12 May 2024 10:57:11 -0400 Subject: [PATCH] spotifyd Stuff --- hosts/kim/annika.nix | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/hosts/kim/annika.nix b/hosts/kim/annika.nix index 6efa203..1dac839 100644 --- a/hosts/kim/annika.nix +++ b/hosts/kim/annika.nix @@ -45,6 +45,9 @@ # Helper stuff pkgs.nixpkgs-fmt + + # Don't know what to call this + pkgs.spotifyd ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage @@ -117,16 +120,28 @@ }; }; - services.spotifyd = { - enable = true; - settings = { - global = { - username = "me@annikamerris.com"; - password = "R%3@TNGQYckkGopY"; - use_mpris = true; - device_name = "kim-nix"; - device_type = "computer"; - }; + # Install and setup spotifyd + sops.templates."spotifyd.conf".content = '' + [global] + username = "me@annikamerris.com" + password = "${config.sops.placeholder."spotifyd/settings/global/password"}" + use_mpris = true + device_name = "kim-nix" + device_type = "computer" + ''; + systemd.user.services.spotifyd = { + Unit = { + Description = "spotify daemon"; + Documentation = "https://github.com/Spotifyd/spotifyd"; + }; + + Install.WantedBy = [ "default.target" ]; + + Service = { + ExecStart = + "${pkgs.spotifyd}/bin/spotifyd --no-daemon --config-path ${config.sops.templates."spotifyd.conf".path}"; + Restart = "always"; + RestartSec = 12; }; };