replace networkmanager with systemd-networkd (again)

This commit is contained in:
Adithya 2024-12-07 19:17:49 +05:30
parent 46c8dca034
commit 1072924034
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
3 changed files with 77 additions and 18 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ...}: { pkgs, ... }:
let let
theme = { theme = {
name = "Dracula"; name = "Dracula";

View file

@ -7,6 +7,81 @@
fallbackDns = [ ]; fallbackDns = [ ];
}; };
systemd = {
network = {
enable = true;
wait-online = {
enable = true;
anyInterface = true;
};
networks = {
"20-virbr" = {
matchConfig = {
Name = "virbr*";
Type = "bridge";
};
linkConfig = {
Unmanaged = true;
};
};
"21-docker" = {
matchConfig = {
Name = "docker*";
Type = "bridge";
};
linkConfig = {
Unmanaged = true;
};
};
"22-veth" = {
matchConfig = {
Name = "veth*";
Type = "ether";
};
linkConfig = {
Unmanaged = true;
};
};
"40-ether" = {
enable = true;
matchConfig = {
Type = "ether";
};
networkConfig = {
DHCP = "yes";
};
dhcpV4Config = {
UseDomains = true;
RouteMetric = 100;
};
ipv6AcceptRAConfig = {
RouteMetric = 100;
};
};
"40-wireless" = {
enable = true;
matchConfig = {
Type = "wlan";
};
networkConfig = {
DHCP = "yes";
IgnoreCarrierLoss = "3s";
};
dhcpV4Config = {
UseDomains = true;
RouteMetric = 600;
};
ipv6AcceptRAConfig = {
RouteMetric = 600;
};
linkConfig = {
RequiredForOnline = "routable";
};
};
};
};
};
networking = { networking = {
nameservers = [ nameservers = [
"10.10.10.1" "10.10.10.1"
@ -34,16 +109,6 @@
]; ];
}; };
networkmanager = {
enable = true;
dhcp = "dhcpcd";
dns = "systemd-resolved";
wifi = {
backend = "iwd";
powersave = false;
};
};
wireless.iwd = { wireless.iwd = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,8 +1,4 @@
_: _: let persistant-path = "/persist/system"; in {
let
persistant-path = "/persist/system";
in
{
environment = { environment = {
etc = { etc = {
"machine-id" = { "machine-id" = {
@ -14,7 +10,6 @@ in
persistence."${persistant-path}" = { persistence."${persistant-path}" = {
hideMounts = true; hideMounts = true;
directories = [ directories = [
"/etc/NetworkManager/system-connections"
"/etc/systemd/nspawn" "/etc/systemd/nspawn"
"/root/.local/share/nix" "/root/.local/share/nix"
"/var/cache/fwupd" "/var/cache/fwupd"
@ -24,7 +19,6 @@ in
"/var/lib/iwd" "/var/lib/iwd"
"/var/lib/libvirt" "/var/lib/libvirt"
"/var/lib/machines" "/var/lib/machines"
"/var/lib/NetworkManager"
"/var/lib/nixos" "/var/lib/nixos"
"/var/lib/portables" "/var/lib/portables"
"/var/lib/systemd" "/var/lib/systemd"