]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/mpd/default.nix
d59a34cd0b5048858e6e025d1b2ffcbcca6b47b8
[perso/Immae/Config/Nix.git] / nixops / modules / mpd / default.nix
1 { lib, pkgs, config, myconfig, mylibs, ... }:
2 {
3 config = {
4 deployment.keys = {
5 mpd = {
6 permissions = "0400";
7 text = myconfig.env.mpd.password;
8 };
9 };
10 networking.firewall.allowedTCPPorts = [ 6600 ];
11 users.users.mpd.extraGroups = [ "wwwrun" ];
12 services.mpd = {
13 enable = true;
14 network.listenAddress = "any";
15 musicDirectory = myconfig.env.mpd.folder;
16 extraConfig = ''
17 password "${myconfig.env.mpd.password}@read,add,control,admin"
18 audio_output {
19 type "null"
20 name "No Output"
21 mixer_type "none"
22 }
23 audio_output {
24 type "httpd"
25 name "OGG"
26 encoder "vorbis"
27 port "${myconfig.env.ports.mpd_ogg}"
28 bind_to_address "127.0.0.1"
29 quality "5.0"
30 format "44100:16:1"
31 }
32 audio_output {
33 type "httpd"
34 name "MP3"
35 encoder "lame"
36 port "${myconfig.env.ports.mpd_mp3}"
37 bind_to_address "127.0.0.1"
38 quality "5.0"
39 format "44100:16:1"
40 }
41
42
43 '';
44 };
45 };
46 }
47