diff options
-rw-r--r-- | machines/labnet/labtops.nix | 17 | ||||
-rw-r--r-- | modules/user/openlab/speedtest.nix | 7 |
2 files changed, 16 insertions, 8 deletions
diff --git a/machines/labnet/labtops.nix b/machines/labnet/labtops.nix index 29ea5507..f8393b34 100644 --- a/machines/labnet/labtops.nix +++ b/machines/labnet/labtops.nix @@ -15,7 +15,8 @@ }; hannswurscht = { pkgs, ... }: - let musicDir = "/data/music"; in + let musicDir = "/data/music"; + webserverRootDir = "/var/www"; in { vuizvui.user.openlab.base.enable = true; @@ -46,8 +47,20 @@ enable = true; volume = 40; }; - vuizvui.user.openlab.speedtest.enable = true; + vuizvui.user.openlab.speedtest = { + enable = true; + outputPath = "${webserverRootDir}/speedtest.yaml"; + }; + + services.nginx = { + enable = true; + virtualHosts."hannswurscht.openlab.lan" = { + default = true; + root = webserverRootDir; + }; + }; + # machine mostly runs headless with the screen shut services.logind.extraConfig = "HandleLidSwitch=ignore"; fileSystems = { diff --git a/modules/user/openlab/speedtest.nix b/modules/user/openlab/speedtest.nix index c0b248b2..e8770410 100644 --- a/modules/user/openlab/speedtest.nix +++ b/modules/user/openlab/speedtest.nix @@ -14,6 +14,7 @@ let speedtest = pkgs.writeScript "speedtest" '' #!${bin pkgs.bash "bash"} + mkdir -p "$(dirname "${cfg.outputPath}")" ${bin pkgs.python3 "python3"} ${py} >> "${cfg.outputPath}" ''; @@ -37,12 +38,6 @@ in { after = [ "network.target" ]; script = "${speedtest}"; startAt = [ "*-*-* *:00/15:00" ]; - serviceConfig.User = "speedtest"; - }; - - users.users.speedtest = { - createHome = false; - home = "/var/lib/speedtest"; }; assertions = [ { |