diff options
author | makefu <github@syntax-fehler.de> | 2018-09-03 00:37:13 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2018-09-03 00:37:13 +0200 |
commit | 481376c1509661cbf1bdb17b9887b3a4f0487b6f (patch) | |
tree | b2c85b7684eb69e16a2d5170b1700a204baa7831 /krebs/2configs/shack | |
parent | bf1747adb41e7c255f0c863b38cf446a70dcccab (diff) |
wolf.r: add mobile mpd web frontends
Diffstat (limited to 'krebs/2configs/shack')
-rw-r--r-- | krebs/2configs/shack/mobile.mpd.nix | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/krebs/2configs/shack/mobile.mpd.nix b/krebs/2configs/shack/mobile.mpd.nix new file mode 100644 index 000000000..2dc466edb --- /dev/null +++ b/krebs/2configs/shack/mobile.mpd.nix @@ -0,0 +1,32 @@ +{lib,pkgs, ... }: +let + mpdHost = "mpd.shack"; + ympd = name: port: let + webPort = 10000 + port; + in { + systemd.services."ympd-${name}" = { + description = "mpd for ${name}"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${pkgs.ympd}/bin/ympd --host ${mpdHost} --port ${toString port} --webport ${toString webPort} --user nobody"; + }; + services.nginx.virtualHosts."mobile.${name}.mpd.shack" = { + serverAliases = [ + "${name}.mpd.wolf.r" + "${name}.mpd.wolf.shack" + ]; + locations."/".proxyPass = "http://localhost:${toString webPort}"; + }; + }; +in lib.mkMerge [{ + services.nginx.enable = true; +} + (ympd "lounge" 6600) + (ympd "seminarraum" 6601) + (ympd "elab" 6602) + (ympd "kueche" 6603) + (ympd "crafting" 6604) + (ympd "fablab" 6605) + (ympd "workshop" 6606) + (ympd "klo" 6607) + +] |