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
theme = {
name = "Dracula";

View file

@ -7,6 +7,81 @@
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 = {
nameservers = [
"10.10.10.1"
@ -34,16 +109,6 @@
];
};
networkmanager = {
enable = true;
dhcp = "dhcpcd";
dns = "systemd-resolved";
wifi = {
backend = "iwd";
powersave = false;
};
};
wireless.iwd = {
enable = true;
settings = {

View file

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