summaryrefslogtreecommitdiff
path: root/hosts/toaster/network
diff options
context:
space:
mode:
authorGrisha Shipunov2025-02-25 22:21:34 +0100
committerGrisha Shipunov2025-03-17 12:47:38 +0100
commit0d5bc74f8840864c28d1670c5a1c4cced81f1f2e (patch)
treec5db24fb67f437b35928ee2fa1134b49452ca7c3 /hosts/toaster/network
parent5464226af78c9c461506ab75d0db3acfa22541fa (diff)
some initial work on niri
Diffstat (limited to 'hosts/toaster/network')
-rw-r--r--hosts/toaster/network/default.nix59
1 files changed, 44 insertions, 15 deletions
diff --git a/hosts/toaster/network/default.nix b/hosts/toaster/network/default.nix
index 6d96c3c..ee0bdbe 100644
--- a/hosts/toaster/network/default.nix
+++ b/hosts/toaster/network/default.nix
@@ -1,4 +1,4 @@
-{ lib, config, ... }:
+{ lib, pkgs, ... }:
{
imports = [
./mullvad.nix
@@ -6,26 +6,21 @@
./zw.nix
];
- # Networkmanager shouldn't interfere with systemd managed interfaces
- networking.networkmanager.unmanaged =
- let
- systemd_netdevs = lib.attrsets.attrValues (
- lib.attrsets.mapAttrs (_name: value: value.netdevConfig.Name) config.systemd.network.netdevs
- );
- in
- systemd_netdevs;
-
- systemd.network = {
- enable = true;
- wait-online.enable = false; # uplink is managed by networkmanager
- };
+ environment.systemPackages = with pkgs; [
+ iwgtk
+ impala
+ ];
- users.users."0xa".extraGroups = [ "networkmanager" ];
+ # kick out networkmanager
+ networking.networkmanager.enable = lib.mkForce false;
+ networking.useNetworkd = true;
+ systemd.network.enable = true;
networking = {
hostName = "toaster";
firewall.enable = true;
wireguard.enable = true;
+ wireless.iwd.enable = true;
};
services.resolved = {
@@ -39,4 +34,38 @@
];
};
+ # we might have no interwebs at all
+ systemd.network.wait-online.enable = false;
+
+ # uplinks
+ systemd.network.networks = {
+ "10-ether-uplink" = {
+ matchConfig.Name = "enp1s0f0";
+ networkConfig = {
+ DHCP = "yes";
+ IPv6AcceptRA = true;
+ };
+ };
+ "10-dock-uplink" = {
+ matchConfig.Name = "enp5s0f4u1u1";
+ networkConfig = {
+ DHCP = "yes";
+ IPv6AcceptRA = true;
+ };
+ dhcpV4Config = {
+ RouteMetric = 666;
+ };
+ dhcpV6Config = {
+ RouteMetric = 666;
+ };
+ };
+ "wlan-uplink" = {
+ matchConfig.Name = "wlan0";
+ networkConfig = {
+ DHCP = "yes";
+ IPv6AcceptRA = true;
+ };
+ };
+ };
+
}