From d2828fa7516b0f8f0c8716e207e418428fc88a45 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 30 Jan 2025 14:45:58 -0800 Subject: [PATCH] Feature: Add spotify module. - librespot as systemd service for backend. - Spotify-qt for qt-based GUI. - ncspot for TUI. --- dotfiles/modules/programs/spotify.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dotfiles/modules/programs/spotify.nix diff --git a/dotfiles/modules/programs/spotify.nix b/dotfiles/modules/programs/spotify.nix new file mode 100644 index 00000000..0fbf5041 --- /dev/null +++ b/dotfiles/modules/programs/spotify.nix @@ -0,0 +1,22 @@ +{ pkgs, sys, ... }: { + networking.firewall.allowedTCPPorts = [ 57621 ]; + networking.firewall.allowedUDPPorts = [ 5353 ]; + home-manager.users.${sys.username} = { + home.packages = with pkgs; [ + spotify-qt + ncspot + librespot + ]; + systemd.user.services.librespot = { + Unit = { + Description = "Librespot (an open source Spotify client)"; + Documentation = [ "https://github.com/librespot-org/librespot" "https://github.com/librespot-org/librespot/wiki/Options" ]; + }; + Service = { + Restart = "always"; + RestartSec = 10; + ExecStart = "${pkgs.librespot}/bin/librespot --backend pulseaudio --system-cache /home/${sys.username}/.spotify -j"; + }; + }; + }; +} \ No newline at end of file