aboutsummaryrefslogtreecommitdiff
path: root/profiles/media.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2026-01-26 18:57:39 -0800
committerFranck Cuny <franck@fcuny.net>2026-01-26 18:57:39 -0800
commit88d1bcd7863b0f4a10ca3cb873db0d8b3fb09a19 (patch)
tree0a3597bc60ea35a4986e2a014a9b1b8df390b410 /profiles/media.nix
parentadd nas public key to ssh know hosts (diff)
downloadinfra-88d1bcd7863b0f4a10ca3cb873db0d8b3fb09a19.tar.gz
run mpd on the framebox
Diffstat (limited to '')
-rw-r--r--profiles/media.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/profiles/media.nix b/profiles/media.nix
new file mode 100644
index 0000000..598eaa2
--- /dev/null
+++ b/profiles/media.nix
@@ -0,0 +1,40 @@
+{ config, ... }:
+{
+ services.mpd = {
+ enable = true;
+ network = {
+ listenAddress = "0.0.0.0";
+ port = 6600;
+ };
+ musicDirectory = "/data/media/music";
+ extraConfig = ''
+ auto_update "yes"
+ auto_update_depth "3"
+ audio_output {
+ type "httpd"
+ name "HTTP Stream"
+ encoder "opus"
+ port "8000"
+ bitrate "128000"
+ format "48000:16:2"
+ always_on "yes"
+ tags "yes"
+ }
+ '';
+ };
+
+ networking.firewall.allowedTCPPorts = [
+ 6600
+ 8000
+ ];
+
+ environment.persistence."/persist/save" = {
+ directories = [
+ {
+ directory = config.services.mpd.dataDir;
+ user = config.services.mpd.user;
+ group = config.services.mpd.group;
+ }
+ ];
+ };
+}