]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/mpd/default.nix
Add mpd and make adjustments
[perso/Immae/Config/Nix.git] / nixops / modules / mpd / default.nix
diff --git a/nixops/modules/mpd/default.nix b/nixops/modules/mpd/default.nix
new file mode 100644 (file)
index 0000000..7781b36
--- /dev/null
@@ -0,0 +1,41 @@
+{ lib, pkgs, config, myconfig, mylibs, ... }:
+{
+  config = {
+    networking.firewall.allowedTCPPorts = [ 6600 ];
+    users.users.mpd.extraGroups = [ "wwwrun" ];
+    services.mpd = {
+      enable = true;
+      network.listenAddress = "any";
+      musicDirectory = myconfig.env.mpd.folder;
+      extraConfig = ''
+        password "${myconfig.env.mpd.password}@read,add,control,admin"
+        audio_output {
+          type            "null"
+          name            "No Output"
+          mixer_type      "none"
+        }
+        audio_output {
+          type            "httpd"
+          name            "OGG"
+          encoder         "vorbis"
+          port            "${myconfig.env.ports.mpd_ogg}"
+          bind_to_address "127.0.0.1"
+          quality         "5.0"
+          format          "44100:16:1"
+        }
+        audio_output {
+          type            "httpd"
+          name            "MP3"
+          encoder         "lame"
+          port            "${myconfig.env.ports.mpd_mp3}"
+          bind_to_address "127.0.0.1"
+          quality         "5.0"
+          format          "44100:16:1"
+        }
+
+
+        '';
+    };
+  };
+}
+