Compare commits

..

2 commits

Author SHA1 Message Date
Vinzenz Schroeter
87bb177072 vpn2: split nginx config 2026-01-04 20:17:22 +01:00
Vinzenz Schroeter
555c98b627 add headscale 2026-01-04 20:16:56 +01:00
4 changed files with 74 additions and 49 deletions

View file

@ -0,0 +1,43 @@
{ pkgs, ... }:
let
blog-domain-socket = "/run/nginx/blog.sock";
anubis-domain-socket = "/run/anubis/anubis-main/anubis.sock";
anubis-metrics-socket = "/run/anubis/anubis-main/anubis-metrics.sock";
in
{
systemd.services = {
nginx.serviceConfig.SupplementaryGroups = [ "anubis" ];
anubis-main.serviceConfig.SupplementaryGroups = [ "nginx" ];
};
services = {
nginx.virtualHosts = {
"zerforschen.plus" = {
addSSL = true;
enableACME = true;
locations = {
"/_metrics".proxyPass = "http://unix:" + anubis-metrics-socket + ":/metrics";
"/".proxyPass = "http://unix:" + anubis-domain-socket;
};
};
"blog-in-anubis" = {
root = pkgs.zerforschen-plus-content;
listen = [
{
addr = "unix:" + blog-domain-socket;
}
];
};
};
anubis.instances.main = {
enable = true;
settings = {
BIND = anubis-domain-socket;
TARGET = "unix://" + blog-domain-socket;
METRICS_BIND = anubis-metrics-socket;
};
};
};
}

View file

@ -2,6 +2,8 @@
imports = [
./hardware.nix
./nginx.nix
./headscale.nix
./blog.nix
];
config = {

View file

@ -0,0 +1,23 @@
let
headscale-port = 8668;
in
{
services = {
headscale = {
enable = true;
address = "localhost";
port = headscale-port;
settings = {
dns.base_domain = "high-gravity.space";
server_url = "https://headscale.zerforschen.plus";
};
};
nginx.virtualHosts."uplink.darkest.space" = {
addSSL = true;
enableACME = true;
locations = {
"/".proxyPass = "http://localhost:" + headscale-port;
};
};
};
}

View file

@ -1,62 +1,19 @@
{ pkgs, ... }:
let
blog-domain-socket = "/run/nginx/blog.sock";
anubis-domain-socket = "/run/anubis/anubis-main/anubis.sock";
anubis-metrics-socket = "/run/anubis/anubis-main/anubis-metrics.sock";
in
{
security.acme = {
acceptTerms = true;
defaults.email = "acme@zerforschen.plus";
};
systemd.services = {
nginx.serviceConfig.SupplementaryGroups = [ "anubis" ];
anubis-main.serviceConfig.SupplementaryGroups = [ "nginx" ];
};
services = {
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
virtualHosts = {
"zerforschen.plus" = {
addSSL = true;
enableACME = true;
locations = {
"/_metrics".proxyPass = "http://unix:" + anubis-metrics-socket + ":/metrics";
"/".proxyPass = "http://unix:" + anubis-domain-socket;
};
};
"blog-in-anubis" = {
root = pkgs.zerforschen-plus-content;
listen = [
{
addr = "unix:" + blog-domain-socket;
}
];
};
};
};
anubis.instances.main = {
enable = true;
settings = {
BIND = anubis-domain-socket;
TARGET = "unix://" + blog-domain-socket;
METRICS_BIND = anubis-metrics-socket;
};
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
};
networking.firewall.allowedTCPPorts = [
80
443
5201
];
}