This commit is contained in:
commit
30ce0dafc2
195 changed files with 8902 additions and 0 deletions
32
services/networking/service.nix
Normal file
32
services/networking/service.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, hostname, ... }:
|
||||
let
|
||||
inherit (config.machine) ipv4 gateway;
|
||||
in
|
||||
with lib; {
|
||||
networking = {
|
||||
hostName = hostname;
|
||||
networkmanager.enable = mkDefault true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowPing = true;
|
||||
};
|
||||
nameservers = [
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
"9.9.9.9"
|
||||
"8.8.8.8"
|
||||
];
|
||||
interfaces.ens3 = mkIf (ipv4 != null) {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = ipv4;
|
||||
prefixLength = 32;
|
||||
}
|
||||
];
|
||||
};
|
||||
defaultGateway = mkIf (gateway != null) {
|
||||
address = gateway;
|
||||
interface = "ens3";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue