diff --git a/hosts/rico1/default.nix b/hosts/rico1/default.nix index 68ef7c1..645df76 100644 --- a/hosts/rico1/default.nix +++ b/hosts/rico1/default.nix @@ -4,12 +4,12 @@ ./programs ./services ./containers + ./network.nix ./security.nix ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "Rico1"; i18n = { defaultLocale = "en_US.UTF-8"; diff --git a/hosts/rico1/network.nix b/hosts/rico1/network.nix new file mode 100644 index 0000000..6e07c8a --- /dev/null +++ b/hosts/rico1/network.nix @@ -0,0 +1,33 @@ +{lib, ...}: { + networking = { + hostName = "Rico1"; + useDHCP = lib.mkDefault false; + }; + + services.resolved.enable = true; + + systemd.network = { + enable = true; + networks = { + "40-ether" = { + enable = true; + matchConfig = { + Type = "ether"; + }; + networkConfig = { + DHCP = "yes"; + IgnoreCarrierLoss = "3s"; + }; + dhcpV4Config = { + UseDomains = true; + }; + ipv6AcceptRAConfig = { + UseDomains = true; + }; + linkConfig = { + RequiredForOnline = "yes"; + }; + }; + }; + }; +} diff --git a/hosts/rico2/default.nix b/hosts/rico2/default.nix index a815bd4..645df76 100644 --- a/hosts/rico2/default.nix +++ b/hosts/rico2/default.nix @@ -4,12 +4,12 @@ ./programs ./services ./containers + ./network.nix ./security.nix ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "Rico2"; i18n = { defaultLocale = "en_US.UTF-8"; diff --git a/hosts/rico2/network.nix b/hosts/rico2/network.nix new file mode 100644 index 0000000..6767bbe --- /dev/null +++ b/hosts/rico2/network.nix @@ -0,0 +1,33 @@ +{lib, ...}: { + networking = { + hostName = "Rico2"; + useDHCP = lib.mkDefault false; + }; + + services.resolved.enable = true; + + systemd.network = { + enable = true; + networks = { + "40-ether" = { + enable = true; + matchConfig = { + Type = "ether"; + }; + networkConfig = { + DHCP = "yes"; + IgnoreCarrierLoss = "3s"; + }; + dhcpV4Config = { + UseDomains = true; + }; + ipv6AcceptRAConfig = { + UseDomains = true; + }; + linkConfig = { + RequiredForOnline = "yes"; + }; + }; + }; + }; +}