pvv-nixos-config/modules/grzegorz.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.4 KiB
Nix
Raw Normal View History

2023-09-03 01:06:48 +02:00
{config, lib, pkgs, ...}:
let
2024-10-19 23:29:54 +02:00
grg = config.services.greg-ng;
2023-09-03 01:06:48 +02:00
grgw = config.services.grzegorz-webui;
in {
2024-10-19 23:29:54 +02:00
imports = [ ./greg.nix ];
services.greg-ng = {
enable = true;
settings.host = "localhost";
settings.port = 31337;
enableSway = true;
enablePipewire = true;
2023-09-03 01:06:48 +02:00
};
2024-10-19 23:29:54 +02:00
services.grzegorz-webui = {
enable = true;
listenAddr = "localhost";
listenPort = 42069;
listenWebsocketPort = 42042;
hostName = "${config.networking.fqdn}";
apiBase = "http://${grg.settings.host}:${toString grg.settings.port}/api";
};
2023-09-03 01:06:48 +02:00
services.nginx.enable = true;
services.nginx.virtualHosts."${config.networking.fqdn}" = {
forceSSL = true;
enableACME = true;
2024-04-10 22:01:19 +02:00
kTLS = true;
2023-09-03 01:06:48 +02:00
serverAliases = [
"${config.networking.hostName}.pvv.org"
];
extraConfig = ''
allow 129.241.210.128/25;
allow 2001:700:300:1900::/64;
deny all;
'';
locations."/" = {
2024-10-19 23:29:54 +02:00
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenPort}";
2023-09-03 01:06:48 +02:00
};
# https://github.com/rawpython/remi/issues/216
locations."/websocket" = {
2024-10-19 23:29:54 +02:00
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenWebsocketPort}";
2023-09-03 01:06:48 +02:00
proxyWebsockets = true;
};
locations."/api" = {
2024-10-19 23:29:54 +02:00
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
2023-09-03 01:06:48 +02:00
};
locations."/docs" = {
2024-10-19 23:29:54 +02:00
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
2023-09-03 01:06:48 +02:00
};
};
}