grimm-nixos-laptop/modules/puffer.nix

67 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2024-05-08 21:50:08 +02:00
{
lib,
config,
inputs,
pkgs,
...
}:
2024-05-08 21:49:37 +02:00
let
inherit (config.networking) domain;
puffer_port = 8080;
puffer_sftp_port = 5657;
puffer_host = "puffer.${domain}";
tlemap_host = "tlemap.${domain}";
tlemap_port = 8100;
2024-05-08 21:50:08 +02:00
in
{
2024-05-08 21:49:37 +02:00
services.pufferpanel = {
enable = true;
environment = {
PUFFER_WEB_HOST = ":${builtins.toString puffer_port}";
PUFFER_DAEMON_SFTP_HOST = ":${builtins.toString puffer_sftp_port}";
};
2024-05-08 21:50:08 +02:00
extraPackages = with pkgs; [ ];
2024-05-08 21:49:37 +02:00
extraGroups = [ "docker" ];
};
services.nginx = {
enable = true;
virtualHosts."${puffer_host}" = {
serverName = puffer_host;
forceSSL = true;
useACMEHost = domain;
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString puffer_port}";
};
};
virtualHosts."${tlemap_host}" = {
serverName = tlemap_host;
forceSSL = true;
useACMEHost = domain;
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString tlemap_port}";
};
};
};
2024-05-08 21:50:08 +02:00
security.acme.certs."${domain}".extraDomainNames = [
puffer_host
tlemap_host
];
networking.firewall.allowedTCPPorts = [
puffer_sftp_port
25565
25566
25567
25568
7270
];
2024-05-08 21:49:37 +02:00
2024-05-08 21:50:08 +02:00
# virtualisation.podman.enable = true;
2024-05-08 21:49:37 +02:00
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [
pufferpanel
(writeShellScriptBin "pufferpanel-nix" "pufferpanel --workDir /var/lib/pufferpanel $@")
];
}