2023-09-03 01:06:48 +02:00
|
|
|
{config, lib, pkgs, ...}:
|
|
|
|
let
|
2024-10-19 21:13:07 +02:00
|
|
|
grg = config.services.greg-ng;
|
2023-09-03 01:06:48 +02:00
|
|
|
grgw = config.services.grzegorz-webui;
|
|
|
|
in {
|
2024-10-19 21:13:07 +02:00
|
|
|
imports = [ ./greg.nix ];
|
|
|
|
|
2023-09-03 01:06:48 +02:00
|
|
|
services.pipewire.enable = true;
|
|
|
|
services.pipewire.alsa.enable = true;
|
|
|
|
services.pipewire.alsa.support32Bit = true;
|
|
|
|
services.pipewire.pulse.enable = true;
|
|
|
|
|
2024-10-19 21:13:07 +02:00
|
|
|
# users.users.pvv = {
|
|
|
|
# isNormalUser = true;
|
|
|
|
# description = "pvv";
|
|
|
|
# };
|
|
|
|
|
|
|
|
# services.grzegorz.enable = true;
|
|
|
|
# services.grzegorz.listenAddr = "localhost";
|
|
|
|
# services.grzegorz.listenPort = 31337;
|
2023-09-03 01:06:48 +02:00
|
|
|
|
2024-10-19 21:13:07 +02:00
|
|
|
services.greg-ng.enable = true;
|
|
|
|
services.greg-ng.settings.host = "localhost";
|
|
|
|
services.greg-ng.settings.port = 31337;
|
2023-09-03 01:06:48 +02:00
|
|
|
|
|
|
|
services.grzegorz-webui.enable = true;
|
|
|
|
services.grzegorz-webui.listenAddr = "localhost";
|
|
|
|
services.grzegorz-webui.listenPort = 42069;
|
|
|
|
services.grzegorz-webui.listenWebsocketPort = 42042;
|
|
|
|
services.grzegorz-webui.hostName = "${config.networking.fqdn}";
|
2024-10-19 21:13:07 +02:00
|
|
|
services.grzegorz-webui.apiBase = "http://${grg.settings.host}:${toString grg.settings.port}/api";
|
2023-09-03 01:06:48 +02:00
|
|
|
|
2024-10-19 21:13:07 +02:00
|
|
|
xdg.portal = {
|
|
|
|
enable = true;
|
|
|
|
wlr.enable = true;
|
|
|
|
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
|
|
|
};
|
2023-09-03 01:06:48 +02:00
|
|
|
|
2024-10-19 21:13:07 +02:00
|
|
|
services.greetd = {
|
|
|
|
enable = true;
|
|
|
|
settings = rec {
|
|
|
|
initial_session = {
|
|
|
|
command = "${pkgs.sway}/bin/sway";
|
|
|
|
user = "greg";
|
|
|
|
};
|
|
|
|
default_session = initial_session;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.sway = {
|
|
|
|
enable = true;
|
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.enable = true;
|
2023-09-03 01:06:48 +02:00
|
|
|
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 21:13:07 +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 21:13:07 +02:00
|
|
|
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenWebsocketPort}";
|
2023-09-03 01:06:48 +02:00
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
locations."/api" = {
|
2024-10-19 21:13:07 +02:00
|
|
|
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
|
2023-09-03 01:06:48 +02:00
|
|
|
};
|
|
|
|
locations."/docs" = {
|
2024-10-19 21:13:07 +02:00
|
|
|
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
|
2023-09-03 01:06:48 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|