split up files more
This commit is contained in:
parent
8ca1862742
commit
164795dfd2
11 changed files with 172 additions and 186 deletions
|
@ -10,6 +10,7 @@ nixpkgs.lib.nixosSystem {
|
|||
common-modules
|
||||
++ [
|
||||
./hardware.nix
|
||||
./nginx.nix
|
||||
../../users/vinzenz.nix
|
||||
../../users/ronja.nix
|
||||
{
|
||||
|
@ -19,7 +20,6 @@ nixpkgs.lib.nixosSystem {
|
|||
# uncomment for build check on non arm system (requires --impure)
|
||||
# nixpkgs.buildPlatform = builtins.currentSystem;
|
||||
}
|
||||
|
||||
{
|
||||
users.users = {
|
||||
root.openssh.authorizedKeys.keys = [
|
||||
|
@ -39,57 +39,5 @@ nixpkgs.lib.nixosSystem {
|
|||
];
|
||||
};
|
||||
}
|
||||
{
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "acme@zerforschen.plus";
|
||||
};
|
||||
|
||||
security.pam.services.nginx.setEnvironment = false;
|
||||
systemd.services.nginx.serviceConfig = {
|
||||
SupplementaryGroups = ["shadow"];
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
additionalModules = [pkgs.nginxModules.pam];
|
||||
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
|
||||
virtualHosts = let
|
||||
servicesDomain = "services.zerforschen.plus";
|
||||
mkServiceConfig = host: port: {
|
||||
addSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${host}:${toString port}/";
|
||||
extraConfig = ''
|
||||
# bind to tailscale ip
|
||||
proxy_bind 100.88.118.60;
|
||||
# pam auth
|
||||
limit_except OPTIONS {
|
||||
auth_pam "Password Required";
|
||||
auth_pam_service_name "nginx";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net";
|
||||
pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net";
|
||||
in {
|
||||
"vscode.${servicesDomain}" = lib.mkMerge [
|
||||
(mkServiceConfig pc2 8542)
|
||||
{locations."/" .proxyWebsockets = true;}
|
||||
];
|
||||
"preon-app.${servicesDomain}" = mkServiceConfig pc2 8543;
|
||||
"preon-api.${servicesDomain}" = mkServiceConfig pc2 8544;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
52
hosts/hetzner-vpn1/nginx.nix
Normal file
52
hosts/hetzner-vpn1/nginx.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{pkgs, ...}: {
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "acme@zerforschen.plus";
|
||||
};
|
||||
|
||||
security.pam.services.nginx.setEnvironment = false;
|
||||
systemd.services.nginx.serviceConfig = {
|
||||
SupplementaryGroups = ["shadow"];
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
additionalModules = [pkgs.nginxModules.pam];
|
||||
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
|
||||
virtualHosts = let
|
||||
servicesDomain = "services.zerforschen.plus";
|
||||
mkServiceConfig = host: port: {
|
||||
addSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${host}:${toString port}/";
|
||||
extraConfig = ''
|
||||
# bind to tailscale ip
|
||||
proxy_bind 100.88.118.60;
|
||||
# pam auth
|
||||
limit_except OPTIONS {
|
||||
auth_pam "Password Required";
|
||||
auth_pam_service_name "nginx";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net";
|
||||
pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net";
|
||||
in {
|
||||
"vscode.${servicesDomain}" = lib.mkMerge [
|
||||
(mkServiceConfig pc2 8542)
|
||||
{locations."/" .proxyWebsockets = true;}
|
||||
];
|
||||
"preon-app.${servicesDomain}" = mkServiceConfig pc2 8543;
|
||||
"preon-api.${servicesDomain}" = mkServiceConfig pc2 8544;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue