Compare commits

...

4 commits

4 changed files with 47 additions and 2 deletions

41
roles/server/adguard.nix Normal file
View file

@ -0,0 +1,41 @@
{lib, ...}: let
domain = "adguard.everest.tailscale";
port = 3001;
in {
services = {
adguardhome = {
enable = true;
host = "127.0.0.1";
port = port;
settings = {
dns = {
bind_hosts = [
"192.168.0.160"
"100.100.0.1"
];
bootstrap_dns = ["9.9.9.9"];
};
};
};
headscale.settings.dns_config = {
nameservers = lib.mkForce ["100.100.0.1"];
extra_records = [
{
name = domain;
type = "A";
value = "100.100.0.1";
}
];
};
caddy.virtualHosts.adguardhome = {
hostName = domain;
extraConfig = ''
import tailscale
reverse_proxy 127.0.0.1:${builtins.toString port}
'';
};
};
programs.rust-motd.settings.service_status."AdGuard Home" = "adguardhome";
}

View file

@ -15,5 +15,6 @@
./caddy.nix
./rust_motd.nix
./minecraft.nix
./adguard.nix
];
}

View file

@ -21,4 +21,5 @@
'';
};
};
programs.rust-motd.settings.service_status.Headscale = "headscale";
}

View file

@ -3,7 +3,7 @@
enable = true;
key = config.age.secrets.syncthingKey.path;
cert = config.age.secrets.syncthingCert.path;
guiAddress = "0.0.0.0:8384";
guiAddress = "127.0.0.1:8384";
settings.folders = {
"passwords" = {
path = "${config.services.syncthing.dataDir}/passwords";
@ -53,7 +53,9 @@
hostName = "sync.everest.tailscale";
extraConfig = ''
import tailscale
reverse_proxy localhost:8384
reverse_proxy localhost:8384 {
header_up Host {upstream_hostport}
}
'';
};
}