SSL configurations to support self-signed certificates on all of my machines.

Tailscale, headscale and SSL modules.
sops-nix secrets management.
This commit is contained in:
boyreau 2026-08-05 16:37:32 +02:00
commit 081d1fa6e1
17 changed files with 267 additions and 29 deletions

25
modules/headscale.nix Normal file
View file

@ -0,0 +1,25 @@
{
services.headscale = {
enable = true;
address = "0.0.0.0";
port = 8080;
settings = {
server_url = "http://0.0.0.0:8080";
dns.magic_dns = false;
dns.override_local_dns = false;
};
};
networking.firewall = {
allowedTCPPorts = [
80
443
8080
# 9090
50443
];
allowedUDPPorts = [
3478
];
};
}

20
modules/ssl.nix Normal file
View file

@ -0,0 +1,20 @@
{
imports = [
"${(import /etc/nixos/npins/default.nix).sops-nix}/modules/sops"
];
security.pki.certificateFiles = [
/etc/nixos/ssl/certs/main.pem
];
environment.etc."ssl/certs/main.pem".source = /etc/nixos/ssl/certs/main.pem;
sops.age.keyFile = "/home/zo/.config/sops/age/keys.txt";
sops.validateSopsFiles = false;
sops.defaultSopsFile = "/etc/nixos/ssl/keys/default.yaml";
sops.secrets.cert_main_key = {
sopsFile = "/etc/nixos/ssl/keys/main.yaml";
mode = "0600";
group = "wheel";
path = "/etc/ssl/keys/main.pem";
};
}

5
modules/tailscale.nix Normal file
View file

@ -0,0 +1,5 @@
{
services.tailscale.enable = true;
services.tailscale.disableUpstreamLogging = true;
services.tailscale.authKeyFile = null;
}