feat: move to own dns

This commit is contained in:
kp2pml30 2026-02-17 19:56:50 +09:00
parent 96e942d8ac
commit eaccf45596
Signed by: kp2pml30
GPG key ID: CD6528BAC23E3E34
15 changed files with 138 additions and 202 deletions

View file

@ -1,7 +1,18 @@
{ pkgs
, lib
, ...
}:
let
ips = import ./server/ips.nix;
groupByAttr = attr: lib.foldlAttrs (acc: _: v:
acc // { ${v.${attr}} = (acc.${v.${attr}} or []) ++ [ v.full-address ]; }
) {} ips.addresses;
groupToLines = lib.mapAttrsToList (ip: domains: "${ip} ${lib.concatStringsSep " " domains}");
in
{
networking.extraHosts = lib.concatStringsSep "\n" (
groupToLines (groupByAttr "ip") ++ groupToLines (groupByAttr "ipv6")
);
system.stateVersion = "24.05";
users.mutableUsers = false;
@ -20,12 +31,7 @@
environment.TMPDIR = "/var/tmp";
};
networking = {
firewall = {
enable = true;
allowedTCPPorts = [ 80 443 ];
};
};
networking.firewall.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = with pkgs; [