16
0
Fork 0

static ip yo

This commit is contained in:
Peder Bergebakken Sundt 2023-08-27 01:01:20 +02:00
parent 9dc6b47a71
commit 4fee576cb4
1 changed files with 38 additions and 6 deletions

View File

@ -23,16 +23,35 @@
grzegorz.nixosModules.grzegorz-kiosk grzegorz.nixosModules.grzegorz-kiosk
grzegorz-clients.nixosModules.grzegorz-webui grzegorz-clients.nixosModules.grzegorz-webui
./hardware-configuration.nix ./hardware-configuration.nix
({ config, ... }: { ({ config, pkgs, ... }: {
system.stateVersion = "23.05"; system.stateVersion = "23.05";
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true; boot.loader.grub.useOSProber = true;
services.resolved.enable = true;
networking.hostName = "brzeczyszczykiewicz"; networking.hostName = "brzeczyszczykiewicz";
networking.domain = "pvv.ntnu.no"; networking.domain = "pvv.ntnu.no";
networking.search = [ "pvv.ntnu.no" ]; networking.search = [ "pvv.ntnu.no" ];
networking = {
interfaces = {
eno1.ipv4.addresses = [{
address = "129.241.210.205";
prefixLength = 25;
}];
eno1.ipv6.addresses = [{
address = "2001:700:300:1900::1:50";
prefixLength = 64;
}];
};
defaultGateway.address = "129.241.210.129";
defaultGateway.interface = "eno1";
defaultGateway6.address = "2001:700:300:1900::1";
defaultGateway6.interface = "eno1";
};
environment.systemPackages = with pkgs; [ git ];
services.openssh.enable = true; services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes"; services.openssh.settings.PermitRootLogin = "yes";
@ -54,12 +73,15 @@
}; };
services.grzegorz.enable = true; services.grzegorz.enable = true;
services.grzegorz.listenAddr = "::1"; services.grzegorz.listenAddr = "localhost";
services.grzegorz.listenPort = 31337; services.grzegorz.listenPort = 31337;
services.grzegorz-webui.enable = true; services.grzegorz-webui.enable = true;
services.grzegorz-webui.listenAddr = "::1"; services.grzegorz-webui.listenAddr = "localhost";
services.grzegorz-webui.apiBase = "http://[::1]:${builtins.toString config.services.grzegorz-webui.listenPort}"; services.grzegorz-webui.listenPort = 42069;
services.grzegorz-webui.listenWebsocketPort = 42042;
services.grzegorz-webui.hostName = "brzeczyszczykiewicz.pvv.ntnu.no";
services.grzegorz-webui.apiBase = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}/api";
#services.grzegorz-webui.apiBase = "https://brzeczyszczykiewicz.pvv.ntnu.no/api"; #services.grzegorz-webui.apiBase = "https://brzeczyszczykiewicz.pvv.ntnu.no/api";
security.acme.acceptTerms = true; security.acme.acceptTerms = true;
@ -69,8 +91,8 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx.virtualHosts."brzeczyszczykiewicz.pvv.ntnu.no" = { services.nginx.virtualHosts."brzeczyszczykiewicz.pvv.ntnu.no" = {
forceSSL = false; forceSSL = true;
enableACME = false; enableACME = true;
serverAliases = [ serverAliases = [
"brzeczyszczykiewicz.pvv.org" "brzeczyszczykiewicz.pvv.org"
"bokhylle.pvv.ntnu.no" "bokhylle.pvv.ntnu.no"
@ -83,8 +105,18 @@
''; '';
locations."/" = { locations."/" = {
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenPort}"; proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenPort}";
};
# https://github.com/rawpython/remi/issues/216
locations."/websocket" = {
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenWebsocketPort}";
proxyWebsockets = true; proxyWebsockets = true;
}; };
locations."/api" = {
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}";
};
locations."/docs" = {
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}";
};
}; };
}) })