mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-24 12:19:12 +00:00
users/foo-dogsquared/setups/music: update Spotify-specific setup
This commit is contained in:
parent
1b62a16c4d
commit
cf20bd5be6
@ -1,6 +1,7 @@
|
|||||||
{ config, lib, pkgs, foodogsquaredLib, ... }@attrs:
|
{ config, lib, pkgs, foodogsquaredLib, ... }@attrs:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (foodogsquaredLib.trivial) unitsToInt;
|
||||||
userCfg = config.users.foo-dogsquared;
|
userCfg = config.users.foo-dogsquared;
|
||||||
cfg = userCfg.setups.music;
|
cfg = userCfg.setups.music;
|
||||||
|
|
||||||
@ -119,8 +120,12 @@ in
|
|||||||
(lib.mkIf cfg.spotify.enable {
|
(lib.mkIf cfg.spotify.enable {
|
||||||
home.packages = with pkgs; [ spotify ];
|
home.packages = with pkgs; [ spotify ];
|
||||||
|
|
||||||
state.ports.spotifyd.value = 9009;
|
state.ports.spotifyd.value = attrs.nixosConfig.services.spotifyd.value or 9009;
|
||||||
|
|
||||||
|
services.mopidy.extensionPackages = [ pkgs.mopidy-spotify ];
|
||||||
|
})
|
||||||
|
|
||||||
|
(lib.mkIf (cfg.spotify.enable && !(attrs.nixosConfig.services.spotifyd.enable or false)) {
|
||||||
services.spotifyd = {
|
services.spotifyd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.global = {
|
settings.global = {
|
||||||
@ -129,10 +134,11 @@ in
|
|||||||
bitrate = 320;
|
bitrate = 320;
|
||||||
device_type = "computer";
|
device_type = "computer";
|
||||||
zeroconf_port = config.state.ports.spotifyd.value;
|
zeroconf_port = config.state.ports.spotifyd.value;
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mopidy.extensionPackages = [ pkgs.mopidy-spotify ];
|
cache_path = "${config.xdg.cacheHome}/spotifyd";
|
||||||
|
max_cache_size = unitsToInt { size = 4; prefix = "G"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(lib.mkIf cfg.mpd.enable {
|
(lib.mkIf cfg.mpd.enable {
|
||||||
|
Loading…
Reference in New Issue
Block a user