nixos-config/configs/nixos/ni/modules/setups/music.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

{ config, lib, foodogsquaredLib, ... }:
2023-12-13 02:42:43 +00:00
let
hostCfg = config.hosts.ni;
cfg = hostCfg.setups.music;
in
{
2023-12-15 05:27:12 +00:00
options.hosts.ni.setups.music.enable =
lib.mkEnableOption "music streaming and organizing setup";
2023-12-13 02:42:43 +00:00
config = lib.mkIf cfg.enable {
state.ports = rec {
gonic = {
value = 4747;
protocols = [ "tcp" ];
openFirewall = true;
};
uxplay = {
value = 10001;
openFirewall = true;
};
uxplayClients = {
value = foodogsquaredLib.nixos.makeRange' uxplay.value 10;
openFirewall = true;
};
};
2023-12-13 02:42:43 +00:00
# My portable music streaming server.
services.gonic = {
enable = true;
settings = rec {
listen-addr = "localhost:${builtins.toString config.state.ports.gonic.value}";
2023-12-13 02:42:43 +00:00
cache-path = "/var/cache/gonic";
music-path =
[
"/srv/Music"
];
podcast-path = "${cache-path}/podcasts";
playlists-path = "${cache-path}/playlists";
2023-12-13 02:42:43 +00:00
jukebox-enabled = true;
scan-interval = 1;
scan-at-start-enabled = true;
};
};
# My AirPlay mirroring server.
services.uxplay = {
enable = true;
extraArgs = [ "-p" (builtins.toString config.state.ports.uxplay.value) ];
};
2023-12-13 02:42:43 +00:00
};
}