From f9bcf79430ac832c4e9534c09c07b744d6d9f395 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 29 May 2021 16:41:59 +0200 Subject: [PATCH] modules: hardware: move 'networking' --- machines/aramis/networking.nix | 10 ++++++---- machines/porthos/networking.nix | 2 +- modules/default.nix | 1 - modules/hardware/default.nix | 1 + modules/hardware/networking.nix | 4 ++-- services/wireguard.nix | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/machines/aramis/networking.nix b/machines/aramis/networking.nix index 929b44d..9322f1f 100644 --- a/machines/aramis/networking.nix +++ b/machines/aramis/networking.nix @@ -15,9 +15,11 @@ }; }; - # Which interface is used to connect to the internet - my.networking.externalInterface = "enp0s3"; + my.hardware.networking = { + # Which interface is used to connect to the internet + externalInterface = "enp0s3"; - # Enable WiFi integration - my.networking.wireless.enable = true; + # Enable WiFi integration + wireless.enable = true; + }; } diff --git a/machines/porthos/networking.nix b/machines/porthos/networking.nix index e593eeb..1e2c9cd 100644 --- a/machines/porthos/networking.nix +++ b/machines/porthos/networking.nix @@ -31,5 +31,5 @@ }; # Which interface is used to connect to the internet - my.networking.externalInterface = "eth0"; + my.hardware.networking.externalInterface = "eth0"; } diff --git a/modules/default.nix b/modules/default.nix index ddc434a..81ece11 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -8,7 +8,6 @@ ./home.nix ./language.nix ./media.nix - ./networking.nix ./nix.nix ./packages.nix ./sound.nix diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 9c762aa..773a6a7 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -5,5 +5,6 @@ imports = [ ./bluetooth.nix ./ergodox.nix + ./networking.nix ]; } diff --git a/modules/hardware/networking.nix b/modules/hardware/networking.nix index 99e1ef3..f0806fe 100644 --- a/modules/hardware/networking.nix +++ b/modules/hardware/networking.nix @@ -1,9 +1,9 @@ { config, lib, ... }: let - cfg = config.my.networking; + cfg = config.my.hardware.networking; in { - options.my.networking = with lib; { + options.my.hardware.networking = with lib; { externalInterface = mkOption { type = types.nullOr types.str; default = null; diff --git a/services/wireguard.nix b/services/wireguard.nix index fc948f6..977c6c5 100644 --- a/services/wireguard.nix +++ b/services/wireguard.nix @@ -18,7 +18,7 @@ let in lib.filterAttrs shouldConnectToPeer allOthers; - extIface = config.my.networking.externalInterface; + extIface = config.my.hardware.networking.externalInterface; mkInterface = clientAllowedIPs: { listenPort = cfg.port;