]>
Commit | Line | Data |
---|---|---|
8a964143 | 1 | { lib, pkgs, config, myconfig, ... }: |
e229e6f2 IB |
2 | { |
3 | config = { | |
1a718805 | 4 | secrets.keys = [ |
742697c9 IB |
5 | { |
6 | dest = "mpd"; | |
914dd76c IB |
7 | permissions = "0400"; |
8 | text = myconfig.env.mpd.password; | |
742697c9 IB |
9 | } |
10 | { | |
11 | dest = "mpd-config"; | |
65e64925 IB |
12 | permissions = "0400"; |
13 | user = "mpd"; | |
14 | group = "mpd"; | |
15 | text = '' | |
16 | password "${myconfig.env.mpd.password}@read,add,control,admin" | |
17 | ''; | |
742697c9 IB |
18 | } |
19 | ]; | |
e229e6f2 | 20 | networking.firewall.allowedTCPPorts = [ 6600 ]; |
65e64925 | 21 | users.users.mpd.extraGroups = [ "wwwrun" "keys" ]; |
81b9ff89 | 22 | systemd.services.mpd.serviceConfig.RuntimeDirectory = "mpd"; |
e229e6f2 IB |
23 | services.mpd = { |
24 | enable = true; | |
25 | network.listenAddress = "any"; | |
26 | musicDirectory = myconfig.env.mpd.folder; | |
27 | extraConfig = '' | |
742697c9 | 28 | include "/var/secrets/mpd-config" |
e229e6f2 IB |
29 | audio_output { |
30 | type "null" | |
31 | name "No Output" | |
32 | mixer_type "none" | |
33 | } | |
34 | audio_output { | |
35 | type "httpd" | |
36 | name "OGG" | |
37 | encoder "vorbis" | |
9df76627 | 38 | bind_to_address "/run/mpd/ogg.sock" |
e229e6f2 IB |
39 | quality "5.0" |
40 | format "44100:16:1" | |
41 | } | |
42 | audio_output { | |
43 | type "httpd" | |
44 | name "MP3" | |
45 | encoder "lame" | |
9df76627 | 46 | bind_to_address "/run/mpd/mp3.sock" |
e229e6f2 IB |
47 | quality "5.0" |
48 | format "44100:16:1" | |
49 | } | |
50 | ||
51 | ||
52 | ''; | |
53 | }; | |
54 | }; | |
55 | } | |
56 |