mirror of
https://github.com/kp2pml30/dotfiles.git
synced 2026-02-20 17:14:41 +04:00
feat: move to own dns
This commit is contained in:
parent
96e942d8ac
commit
eaccf45596
15 changed files with 138 additions and 202 deletions
|
|
@ -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; [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue