50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
# legacy labsync, currently partly implemented in docker outside of this configuration
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
generator_port = 8695;
|
|
in
|
|
{
|
|
services.opentracker.enable = true;
|
|
|
|
services.nginx.virtualHosts."labsync.fablab-nea.de" = {
|
|
addSSL = true;
|
|
enableACME = true;
|
|
locations = {
|
|
"/generator/".proxyPass = "http://127.0.0.1:${toString generator_port}/";
|
|
};
|
|
};
|
|
services.nginx.virtualHosts."labsync.lab.fablab-nea.de" = {
|
|
locations = {
|
|
"/" = {
|
|
root = "/opt/docker/tftpgen/data";
|
|
extraConfig = ''
|
|
autoindex on;
|
|
'';
|
|
};
|
|
"/generator/".proxyPass = "http://127.0.0.1:${toString generator_port}/";
|
|
};
|
|
};
|
|
|
|
services.atftpd = {
|
|
enable = true;
|
|
root = pkgs.runCommand "pxelinux-tftproot" { } ''
|
|
mkdir -p $out/pxelinux.cfg
|
|
cp ${pkgs.syslinux}/share/syslinux/{ldlinux.c32,libcom32.c32,libutil.c32,lpxelinux.0,vesamenu.c32} $out
|
|
cp ${./splash.png} $out/splash.png
|
|
cp ${./pxelinux.cfg} $out/pxelinux.cfg/default
|
|
# required to serve labsync/labsync.cfg, which is generated dynamically by a docker container
|
|
ln -s /opt/docker/tftpgen/data $out/labsync
|
|
'';
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
6881 # aria2
|
|
6969 # opentracker
|
|
];
|
|
networking.firewall.allowedUDPPorts = [
|
|
6882 # aria2
|
|
69 # tftpd
|
|
6969 # opentracker
|
|
];
|
|
}
|