raven/labsync: declaratively build tftp env

Fixes #8.
This commit is contained in:
Simon Bruder 2021-12-28 09:49:44 +01:00
parent 59ff307047
commit 71769cb74c
No known key found for this signature in database
GPG key ID: 8D3C82F9F309F8EC
5 changed files with 38 additions and 3 deletions

2
.gitattributes vendored
View file

@ -1 +1,3 @@
**/secrets.yaml diff=sops
*.png filter=lfs diff=lfs merge=lfs -text

View file

@ -3,7 +3,7 @@
./asterisk.nix
./dnsmasq.nix
./dyndns.nix
./labsync.nix
./labsync
./unifi-controller.nix
];
}

View file

@ -1,11 +1,13 @@
# legacy labsync, currently partly implemented in docker outside of this configuration
{ pkgs, ... }:
{
services.opentracker.enable = true;
services.nginx.virtualHosts."labsync.lab.fablab-nea.de" = {
locations = {
"/" = {
root = "/opt/docker/tftpgen/data/labsync";
root = "/opt/docker/tftpgen/data";
extraConfig = ''
autoindex on;
'';
@ -16,7 +18,14 @@
services.atftpd = {
enable = true;
root = "/opt/docker/tftpgen/data";
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 = [

View file

@ -0,0 +1,21 @@
# default menu settings
menu width 100
menu height 24
menu title labsync
# can be overwriten by mounting another image; has to be 1024×768 in 16:9
menu background splash.png
menu color border * #00000000 #00000000 none
menu color sel * #ffffffff #76a1d0ff *
menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *
menu cmdlinerow 16
menu timeoutrow 16
menu tabmsgrow 18
# do not show “press tab to edit options…” entry (empty)
menu tabmsg
include labsync/labsync.cfg
default vesamenu.c32
# disable timeout (explicitly)
timeout 0

BIN
machines/raven/services/labsync/splash.png (Stored with Git LFS) Normal file

Binary file not shown.