2018-09-02 22:37:13 +00:00
|
|
|
{lib,pkgs, ... }:
|
|
|
|
let
|
2019-01-28 07:29:19 +00:00
|
|
|
pkg = lib.overrideDerivation pkgs.ympd (old: {
|
|
|
|
patches = [ ./ympd-top-next.patch ];
|
|
|
|
});
|
2018-09-02 22:37:13 +00:00
|
|
|
mpdHost = "mpd.shack";
|
|
|
|
ympd = name: port: let
|
|
|
|
webPort = 10000 + port;
|
|
|
|
in {
|
|
|
|
systemd.services."ympd-${name}" = {
|
|
|
|
description = "mpd for ${name}";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2019-01-28 07:29:19 +00:00
|
|
|
serviceConfig.ExecStart = "${pkg}/bin/ympd --host ${mpdHost} --port ${toString port} --webport ${toString webPort} --user nobody";
|
2018-09-02 22:37:13 +00:00
|
|
|
};
|
|
|
|
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)
|
|
|
|
|
|
|
|
]
|