From 88d1bcd7863b0f4a10ca3cb873db0d8b3fb09a19 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 26 Jan 2026 18:57:39 -0800 Subject: run mpd on the framebox --- machines/framebox.nix | 1 + profiles/media.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 profiles/media.nix diff --git a/machines/framebox.nix b/machines/framebox.nix index 57b9c3b..62995be 100644 --- a/machines/framebox.nix +++ b/machines/framebox.nix @@ -44,6 +44,7 @@ ../profiles/git-server.nix ../profiles/hardware/framework-desktop.nix ../profiles/home-manager.nix + ../profiles/media.nix ../profiles/miniflux.nix ../profiles/monitoring.nix ../profiles/postgresql.nix 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; + } + ]; + }; +} -- cgit v1.2.3