initial commit
This commit is contained in:
37
modules/core/network.nix
Normal file
37
modules/core/network.nix
Normal 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];
|
||||
}
|
||||
Reference in New Issue
Block a user