Add hosts file

This commit is contained in:
Filippo Berto 2024-01-07 10:31:18 +01:00
parent 032875eec9
commit 3b6cf23db1
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
4 changed files with 42 additions and 11 deletions

View file

@ -1,15 +1,13 @@
{ lib, ... }:
let
hosts = import ../../../hosts.nix;
zerotier_hosts = lib.attrsets.mapAttrs' (k: v: lib.attrsets.nameValuePair v [ k ]) hosts.zerotier.ipv4;
in
{
services.zerotierone = {
enable = true;
joinNetworks = [ "8056c2e21cf9c753" ];
};
networking.hosts = {
"172.23.24.223" = [ "thor.zto" ];
"172.23.255.161" = [ "x3pro.zto" ];
"172.23.219.133" = [ "odin.zto" ];
"172.23.254.55" = [ "loki.zto" ];
"172.23.18.147" = [ "freya.zto" ];
"172.23.171.70" = [ "baldur.zto" ];
};
networking.hosts = zerotier_hosts;
}

View file

@ -1,4 +1,8 @@
{ pkgs, config, ... }: {
{ pkgs, config, ... }:
let
hosts = import ../../hosts.nix;
in
{
age.secrets = {
nextcloud_admin_secret = { file = ../../secrets/nextcloud_admin_secret.age; owner = "nextcloud"; };
@ -35,7 +39,7 @@
];
config = {
trustedProxies = [ "172.23.171.70" "baldur.zto" ];
trustedProxies = [ hosts.zerotier.ipv4."baldur.zto" hosts.zerotier.ipv6."baldur.zto" "baldur.zto" ];
extraTrustedDomains = [ config.services.nextcloud.hostName "freya.zto" ];
adminpassFile = config.age.secrets.nextcloud_admin_secret.path;
overwriteProtocol = "https";