switch to systemd-{resolved,networkd}

This commit is contained in:
Adithya 2023-08-19 23:20:07 +05:30
parent 9c217529ae
commit 4966cec1e1
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
4 changed files with 68 additions and 2 deletions

View file

@ -4,12 +4,12 @@
./programs ./programs
./services ./services
./containers ./containers
./network.nix
./security.nix ./security.nix
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "Rico1";
i18n = { i18n = {
defaultLocale = "en_US.UTF-8"; defaultLocale = "en_US.UTF-8";

33
hosts/rico1/network.nix Normal file
View file

@ -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";
};
};
};
};
}

View file

@ -4,12 +4,12 @@
./programs ./programs
./services ./services
./containers ./containers
./network.nix
./security.nix ./security.nix
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "Rico2";
i18n = { i18n = {
defaultLocale = "en_US.UTF-8"; defaultLocale = "en_US.UTF-8";

33
hosts/rico2/network.nix Normal file
View file

@ -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";
};
};
};
};
}