diff --git a/home/home-default.nix b/home/home-default.nix index 7cd82ee..95213dd 100644 --- a/home/home-default.nix +++ b/home/home-default.nix @@ -186,15 +186,6 @@ package = pkgs.kdePackages.kdeconnect-kde; }; - services.spotifyd = { - enable = true; - settings = { - global = { - username = "johnogle222"; - }; - }; - }; - services.syncthing = { enable = true; tray = { diff --git a/machines/z790prors/configuration.nix b/machines/z790prors/configuration.nix index 11e9f18..ed68052 100644 --- a/machines/z790prors/configuration.nix +++ b/machines/z790prors/configuration.nix @@ -19,6 +19,7 @@ kodi.enable = true; nfs-mounts.enable = true; printing.enable = true; + spotifyd.enable = true; users = { enable = true; extraGroups = [ "input" "libvirtd" ]; diff --git a/roles/default.nix b/roles/default.nix index 1634b41..e801b4e 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -14,6 +14,7 @@ in ./nfs-mounts ./printing ./secrets + ./spotifyd ./users ./virtualisation ]; diff --git a/roles/spotifyd/default.nix b/roles/spotifyd/default.nix new file mode 100644 index 0000000..595aac1 --- /dev/null +++ b/roles/spotifyd/default.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.roles.spotifyd; +in +{ + options.roles.spotifyd = { + enable = mkEnableOption "Enable the spotifyd role"; + }; + + config = { + roles.audio.enable = true; + + services.spotifyd = { + enable = true; + settings = { + global = { + use_mpris = false; + backend = "alsa"; + device = "sysdefault"; + bitrate = 320; + cache_path = ""; + zeroconf_port = 1234; + autoplay = false; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ + 1234 + 57621 + ]; + networking.firewall.allowedUDPPorts = [ + 5353 + ]; + }; +}