initial commit

This commit is contained in:
2026-03-24 19:07:42 +01:00
commit 7a2f92fd98
112 changed files with 12548 additions and 0 deletions

37
modules/core/network.nix Normal file
View File

@@ -0,0 +1,37 @@
{
pkgs,
host,
options,
...
}: let
inherit (import ../../hosts/${host}/variables.nix) hostId;
in {
assertions = [
{
assertion = builtins.match "^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$" host != null;
message = "Invalid hostname '${host}'.";
}
];
networking = {
hostName = "${host}";
hostId = hostId;
networkmanager.enable = true;
timeServers = options.networking.timeServers.default ++ ["pool.ntp.org"];
nameservers = ["1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one"];
firewall = {
enable = true;
allowedTCPPorts = [ 22 80 443 8080 ];
};
};
services.resolved = {
enable = true;
dnssec = "true";
domains = ["~."];
fallbackDns = ["1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one"];
dnsovertls = "true";
};
environment.systemPackages = with pkgs; [networkmanagerapplet];
}