]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/mpd/default.nix
Upgrade MPD to 0.21.7, and move mpd secrets to secure location
[perso/Immae/Config/Nix.git] / nixops / modules / mpd / default.nix
CommitLineData
e229e6f2
IB
1{ lib, pkgs, config, myconfig, mylibs, ... }:
2{
3 config = {
65e64925
IB
4 nixpkgs.overlays = [ (self: super: rec {
5 mpd = (self.callPackage ./mpd.nix {}).mpd;
6 }) ];
914dd76c
IB
7 deployment.keys = {
8 mpd = {
9 permissions = "0400";
10 text = myconfig.env.mpd.password;
11 };
65e64925
IB
12 mpd-config = {
13 permissions = "0400";
14 user = "mpd";
15 group = "mpd";
16 text = ''
17 password "${myconfig.env.mpd.password}@read,add,control,admin"
18 '';
19 };
914dd76c 20 };
e229e6f2 21 networking.firewall.allowedTCPPorts = [ 6600 ];
65e64925 22 users.users.mpd.extraGroups = [ "wwwrun" "keys" ];
e229e6f2
IB
23 services.mpd = {
24 enable = true;
25 network.listenAddress = "any";
26 musicDirectory = myconfig.env.mpd.folder;
27 extraConfig = ''
65e64925 28 include "/run/keys/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"
38 port "${myconfig.env.ports.mpd_ogg}"
39 bind_to_address "127.0.0.1"
40 quality "5.0"
41 format "44100:16:1"
42 }
43 audio_output {
44 type "httpd"
45 name "MP3"
46 encoder "lame"
47 port "${myconfig.env.ports.mpd_mp3}"
48 bind_to_address "127.0.0.1"
49 quality "5.0"
50 format "44100:16:1"
51 }
52
53
54 '';
55 };
56 };
57}
58