Compare commits
3 Commits
aee77e91c7
...
spotifyd
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b10f4abe0 | |||
| a53519c339 | |||
| e88670ed60 |
@@ -19,6 +19,10 @@ with lib;
|
|||||||
autologin = true;
|
autologin = true;
|
||||||
wayland = true;
|
wayland = true;
|
||||||
};
|
};
|
||||||
|
spotifyd = {
|
||||||
|
enable = true;
|
||||||
|
deviceType = "t_v";
|
||||||
|
};
|
||||||
users.enable = true;
|
users.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,16 +13,15 @@ in
|
|||||||
config = mkIf cfg.enable
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
alsa-utils
|
||||||
paprefs
|
paprefs
|
||||||
pavucontrol
|
pavucontrol
|
||||||
pulsemixer
|
pulsemixer
|
||||||
];
|
];
|
||||||
|
|
||||||
services.pipewire = {
|
hardware.pulseaudio.enable = true;
|
||||||
enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||||||
|
hardware.pulseaudio.support32Bit = true;
|
||||||
hardware.pulseaudio.extraConfig = "
|
hardware.pulseaudio.extraConfig = "
|
||||||
load-module module-combine-sink
|
load-module module-combine-sink
|
||||||
load-module module-switch-on-connect
|
load-module module-switch-on-connect
|
||||||
|
|||||||
@@ -4,33 +4,44 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.roles.spotifyd;
|
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
|
in
|
||||||
{
|
{
|
||||||
options.roles.spotifyd = {
|
options.roles.spotifyd = {
|
||||||
enable = mkEnableOption "Enable the spotifyd role";
|
enable = mkEnableOption "Enable the spotifyd role";
|
||||||
|
deviceType = mkOption {
|
||||||
|
default = "computer";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
roles.audio.enable = true;
|
roles.audio.enable = true;
|
||||||
|
|
||||||
services.spotifyd = {
|
systemd.user.services.spotifyd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
wantedBy = [ "default.target" ];
|
||||||
global = {
|
after = [ "network-online.target" "sound.target" ];
|
||||||
use_mpris = false;
|
description = "spotifyd, a Spotify playing daemon";
|
||||||
backend = "alsa";
|
serviceConfig = {
|
||||||
device = "sysdefault";
|
ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --cache-path=\${HOME}/.cache/spotifyd --config-path=${spotifydConf}";
|
||||||
bitrate = 320;
|
Restart = "always";
|
||||||
cache_path = "";
|
RestartSec = 12;
|
||||||
zeroconf_port = 1234;
|
|
||||||
autoplay = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
users.users."kodi".linger = true;
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
1234
|
5354
|
||||||
57621
|
57621
|
||||||
];
|
];
|
||||||
networking.firewall.allowedUDPPorts = [
|
networking.firewall.allowedUDPPorts = [
|
||||||
|
|||||||
Reference in New Issue
Block a user