nixos-config/config/host-config/legatus.nix

131 lines
3.4 KiB
Nix
Raw Normal View History

2021-11-05 07:06:08 -07:00
{ config, lib, pkgs, ... }:
with lib;
let
hostname = "legatus";
2022-08-22 11:30:18 -07:00
host-ipv4 = "190.2.136.47";
2021-11-05 07:06:08 -07:00
domain-name = config.fudo.hosts.${hostname}.domain;
domain = config.fudo.domains.${domain-name};
site-name = config.fudo.hosts.${hostname}.site;
site = config.fudo.sites.${site-name};
local-packages = with pkgs; [ ldns.examples ];
2021-12-18 12:10:42 -08:00
host-secrets = config.fudo.secrets.host-secrets.${hostname};
2021-11-05 07:06:08 -07:00
in {
networking = {
enableIPv6 = true;
nameservers = [ "1.1.1.1" ];
defaultGateway = {
address = site.gateway-v4;
interface = "extif0";
};
interfaces.extif0.ipv4.addresses = [{
address = host-ipv4;
prefixLength = 24;
}];
};
2022-08-22 11:30:18 -07:00
security.acme.defaults.email = "admin@legatus.fudo.org";
2022-06-01 13:57:58 -07:00
systemd.tmpfiles.rules = [ "L /etc/adjtime - - - - /state/etc/adjtime" ];
2021-11-05 07:06:08 -07:00
environment.systemPackages = local-packages;
# networking.firewall.allowedTCPPorts = [ 80 443 ];
# informis.cl-gemini = {
# enable = true;
2022-03-16 09:49:35 -07:00
# hostname = "gemini.fudo.org";
2021-11-05 07:06:08 -07:00
# server-ip = host-ipv4;
2022-03-16 09:49:35 -07:00
# document-root = "/state/gemini/root";
# # textfiles-archive = "${pkgs.textfiles}";
2021-11-05 07:06:08 -07:00
# slynk-port = 4005;
# };
2022-06-01 13:57:58 -07:00
fudo = {
2021-11-05 07:06:08 -07:00
hosts.legatus.external-interfaces = [ "extif0" ];
services = {
auth = {
ldap.state-directory = "/state/auth/ldap";
kerberos = {
state-directory = "/state/auth/kerberos";
2023-05-16 22:40:08 -07:00
# master-key-file = host-secrets.heimdal-master-key.target-file;
# ipropd-keytab = host-secrets.heimdal-ipropd-keytab.target-file;
};
};
2022-06-01 13:57:58 -07:00
chat = {
state-directory = "/state/services/chat";
external-interface = "extif0";
};
2023-05-16 22:40:08 -07:00
nexus.dns-server.listen-addresses = [ host-ipv4 ];
};
2022-06-01 13:57:58 -07:00
secrets.host-secrets.legatus = let files = config.fudo.secrets.files;
2021-11-13 10:30:58 -08:00
in {
2023-05-16 22:40:08 -07:00
# postgres-keytab = {
# source-file = files.service-keytabs.procul.postgres;
# target-file = "/srv/postgres/secure/postgres.keytab";
# user = "root";
# };
2021-11-13 10:30:58 -08:00
# gitea-database-password = {
# source-file = files.service-passwords.procul.gitea-database;
# target-file = "/srv/gitea/secure/database.passwd";
# user = config.fudo.git.user;
# };
2023-05-16 22:40:08 -07:00
# heimdal-master-key = {
# source-file = files.realm-master-keys."FUDO.ORG";
# target-file = "/run/heimdal/master-key";
# user = config.fudo.auth.kdc.user;
# };
2023-05-16 22:40:08 -07:00
# heimdal-ipropd-keytab = {
# source-file = files.service-keytabs.legatus.ipropd;
# target-file = "/run/heimdal/ipropd.keytab";
# user = config.fudo.auth.kdc.user;
# };
2021-11-13 10:30:58 -08:00
};
2021-11-05 07:06:08 -07:00
2021-11-13 10:30:58 -08:00
client.dns = {
ipv4 = true;
ipv6 = true;
user = "fudo-client";
external-interface = "extif0";
};
2021-11-05 07:06:08 -07:00
# auth.kdc = {
# enable = true;
# realm = "FUDO.ORG";
# bind-addresses = [ host-ipv4 "127.0.0.1" ];
# master-key-file =
# secrets.heimdal-master-key.target-file;
# state-directory = "/state/kerberos";
# slave-config = {
# master-host = "france";
# ipropd-keytab = secrets.ipropd-keytab.target-file;
# };
# };
2021-11-05 07:06:08 -07:00
2021-11-13 10:30:58 -08:00
secure-dns-proxy = {
enable = true;
upstream-dns =
[ "https://1.1.1.1/dns-query" "https://1.0.0.1/dns-query" ];
bootstrap-dns = "1.1.1.1";
listen-ips = [ "127.0.0.1" ];
listen-port = 53;
allowed-networks = [ "1.1.1.1/32" "1.0.0.1/32" "localhost" "link-local" ];
};
2021-11-05 07:06:08 -07:00
2021-11-13 10:30:58 -08:00
dns.state-directory = "/state/nsd";
2021-11-05 07:06:08 -07:00
};
}