summaryrefslogtreecommitdiff
path: root/nix/modules/home/mpd.nix
blob: 2ab711b4b38f178e7c1f3df5396d41e65469be26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib, config, ... }:
{
  services.mpd = {
  enable = lib.mkDefault config.monorepo.profiles.music.enable;
  dbFile = "/home/${config.monorepo.vars.userName}/.config/mpd/db";
  dataDir = "/home/${config.monorepo.vars.userName}/.config/mpd/";
  network.port = 6600;
  musicDirectory = "/home/${config.monorepo.vars.userName}/music";
  playlistDirectory = "/home/${config.monorepo.vars.userName}/.config/mpd/playlists";
  network.listenAddress = "0.0.0.0";
  extraConfig = ''
      audio_output {
        type "pipewire"
        name "pipewire output"
      }

      audio_output {
        type		"httpd"
        name		"Ret2pop's Music Stream"
        encoder		"opus"		# optional
        port		"8000"
        bitrate		"128000"
        format		"48000:16:1"
        always_on       "yes"
        tags            "yes"
      }

audio_output {
    type            "shout"
    name            "My VPS Stream"
    host            "127.0.0.1"
    port            "8888"             # This must match your SSH tunnel local port
    mount           "/stream"          # The URL path (e.g. http://vps:8000/stream)
    password        "SuperSecretSourcePass"
    bitrate         "128"
    format          "44100:16:2"
    protocol        "icecast2"         # Essential for modern Icecast
    user            "source"           # Default icecast source user
    description     "My MPD Stream"
    genre           "Mixed"
}
    '';
  };
}