summaryrefslogtreecommitdiff
path: root/nixos/modules/features/mpd
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/features/mpd')
-rw-r--r--nixos/modules/features/mpd/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixos/modules/features/mpd/default.nix b/nixos/modules/features/mpd/default.nix
new file mode 100644
index 0000000..383180d
--- /dev/null
+++ b/nixos/modules/features/mpd/default.nix
@@ -0,0 +1,39 @@
+{ pkgs, ... }:
+
+{
+ # MPD server
+ services.mpd = {
+ enable = true;
+ user = "seraphim";
+ openFirewall = false;
+ settings = {
+ music_directory = "/mnt/giga/music";
+ bind_to_address = "any";
+ port = 6600;
+ auto_update = "yes";
+ audio_output = [
+ {
+ type = "pulse";
+ name = "PipeWire Output";
+ mixer_type = "hardware";
+ }
+ ];
+ };
+ };
+
+ systemd.services.mpd.environment = {
+ XDG_RUNTIME_DIR = "/run/user/1000";
+ };
+
+ # mpd-mpris is the MPRIS bridge for MPD — only useful when MPD is on,
+ # so it lives in the same feature. Disable by removing this block.
+ systemd.user.services.mpd-mpris = {
+ description = "MPD MPRIS Service for Waybar";
+ wantedBy = [ "default.target" ];
+ after = [ "graphical-session.target" ];
+ serviceConfig = {
+ ExecStart = "${pkgs.mpd-mpris}/bin/mpd-mpris -network tcp -host 127.0.0.1 -port 6600";
+ Restart = "on-failure";
+ };
+ };
+} \ No newline at end of file