hosts/suwako: split service files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
perSystem =
|
||||
{ system, pkgs, ... }:
|
||||
rec {
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
formatter = pkgs.nixfmt-tree;
|
||||
devShells.default =
|
||||
with pkgs;
|
||||
mkShell {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
./networking.nix
|
||||
./hardware.nix
|
||||
./boot.nix
|
||||
./services.nix
|
||||
./services
|
||||
./mailserver.nix
|
||||
];
|
||||
|
||||
|
@@ -1,70 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
conf,
|
||||
...
|
||||
}:
|
||||
let
|
||||
domain = conf.network.addresses.domain.natto;
|
||||
in
|
||||
{
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
cron.enable = true;
|
||||
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings.PermitRootLogin = "yes";
|
||||
ports = [ 22 ];
|
||||
};
|
||||
|
||||
nginx = {
|
||||
enable = true;
|
||||
virtualHosts = with conf.network.addresses.wireguard.ips; {
|
||||
"moj.${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "https://${suwako}:25565";
|
||||
};
|
||||
};
|
||||
"puffer.${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${suwako}:8080";
|
||||
};
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Nginx-Proxy true;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 100M;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
pufferpanel = {
|
||||
enable = true;
|
||||
extraGroups = [ "docker" ];
|
||||
package = pkgs.buildFHSEnv {
|
||||
name = "pufferpanel-fhs";
|
||||
runScript = lib.getExe pkgs.pufferpanel;
|
||||
targetPkgs =
|
||||
pkgs': with pkgs'; [
|
||||
icu
|
||||
openssl
|
||||
zlib
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
hosts/suwako/services/default.nix
Normal file
21
hosts/suwako/services/default.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./nginx.nix
|
||||
./pufferpanel.nix
|
||||
];
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
cron.enable = true;
|
||||
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings.PermitRootLogin = "yes";
|
||||
ports = [ 22 ];
|
||||
};
|
||||
};
|
||||
}
|
36
hosts/suwako/services/nginx.nix
Normal file
36
hosts/suwako/services/nginx.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{ conf, ... }:
|
||||
let
|
||||
domain = conf.network.addresses.domain.natto;
|
||||
in
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts = with conf.network.addresses.wireguard.ips; {
|
||||
"moj.${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "https://${suwako}:25565";
|
||||
};
|
||||
};
|
||||
"puffer.${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${suwako}:8080";
|
||||
};
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Nginx-Proxy true;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 100M;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
17
hosts/suwako/services/pufferpanel.nix
Normal file
17
hosts/suwako/services/pufferpanel.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.pufferpanel = {
|
||||
enable = true;
|
||||
extraGroups = [ "docker" ];
|
||||
package = pkgs.buildFHSEnv {
|
||||
name = "pufferpanel-fhs";
|
||||
runScript = lib.getExe pkgs.pufferpanel;
|
||||
targetPkgs =
|
||||
pkgs': with pkgs'; [
|
||||
icu
|
||||
openssl
|
||||
zlib
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user