Compare commits

..

3 Commits

Author SHA1 Message Date
9b10f4abe0 (wip) spotifyd experimentation 2024-10-21 12:31:30 -07:00
a53519c339 [spotifyd] Update to lean in on pulseaudio 2024-10-05 20:37:44 -07:00
e88670ed60 [audio] Switch to pulseaudio
This is an attempt to get spotifyd running as a system user working
2024-10-05 20:37:10 -07:00
3 changed files with 30 additions and 16 deletions

View File

@@ -19,6 +19,10 @@ with lib;
autologin = true;
wayland = true;
};
spotifyd = {
enable = true;
deviceType = "t_v";
};
users.enable = true;
};

View File

@@ -13,16 +13,15 @@ in
config = mkIf cfg.enable
{
environment.systemPackages = with pkgs; [
alsa-utils
paprefs
pavucontrol
pulsemixer
];
services.pipewire = {
enable = true;
pulse.enable = true;
};
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.support32Bit = true;
hardware.pulseaudio.extraConfig = "
load-module module-combine-sink
load-module module-switch-on-connect

View File

@@ -4,33 +4,44 @@ with lib;
let
cfg = config.roles.spotifyd;
spotifyd = pkgs.spotifyd.override { withMpris = true; withPulseAudio = true; };
spotifydConf = pkgs.writeText "spotifyd-config" ''
[global]
backend = "pulseaudio"
bitrate = 320
use_mpris = false
zeroconf_port = 5354
autoplay = false
device_type = "${cfg.deviceType}"
'';
in
{
options.roles.spotifyd = {
enable = mkEnableOption "Enable the spotifyd role";
deviceType = mkOption {
default = "computer";
};
};
config = mkIf cfg.enable
{
roles.audio.enable = true;
services.spotifyd = {
systemd.user.services.spotifyd = {
enable = true;
settings = {
global = {
use_mpris = false;
backend = "alsa";
device = "sysdefault";
bitrate = 320;
cache_path = "";
zeroconf_port = 1234;
autoplay = false;
};
wantedBy = [ "default.target" ];
after = [ "network-online.target" "sound.target" ];
description = "spotifyd, a Spotify playing daemon";
serviceConfig = {
ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --cache-path=\${HOME}/.cache/spotifyd --config-path=${spotifydConf}";
Restart = "always";
RestartSec = 12;
};
};
users.users."kodi".linger = true;
networking.firewall.allowedTCPPorts = [
1234
5354
57621
];
networking.firewall.allowedUDPPorts = [