summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/mobile.mpd.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-09-06 23:10:09 +0200
committertv <tv@krebsco.de>2018-09-06 23:10:09 +0200
commit03764d6765f8d2734d0960bc75cc6856bf0893d8 (patch)
treeb8cbbdc3a0381b5d1b1d08149c38a6bd5be5e9c5 /krebs/2configs/shack/mobile.mpd.nix
parent86466154f11748365cdab50b6ac113bdfd5542be (diff)
parent96c4ab61202f515c7a361ef76c398e542771d6b4 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/2configs/shack/mobile.mpd.nix')
-rw-r--r--krebs/2configs/shack/mobile.mpd.nix32
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)
+
+]