modules: hardware: move 'networking'

This commit is contained in:
Bruno BELANYI 2021-05-29 16:41:59 +02:00
parent abbe1bb203
commit 5f0c1f6a79
6 changed files with 11 additions and 9 deletions

View file

@ -15,9 +15,11 @@
}; };
}; };
# Which interface is used to connect to the internet my.hardware.networking = {
my.networking.externalInterface = "enp0s3"; # Which interface is used to connect to the internet
externalInterface = "enp0s3";
# Enable WiFi integration # Enable WiFi integration
my.networking.wireless.enable = true; wireless.enable = true;
};
} }

View file

@ -31,5 +31,5 @@
}; };
# Which interface is used to connect to the internet # Which interface is used to connect to the internet
my.networking.externalInterface = "eth0"; my.hardware.networking.externalInterface = "eth0";
} }

View file

@ -8,7 +8,6 @@
./home.nix ./home.nix
./language.nix ./language.nix
./media.nix ./media.nix
./networking.nix
./nix.nix ./nix.nix
./packages.nix ./packages.nix
./sound.nix ./sound.nix

View file

@ -5,5 +5,6 @@
imports = [ imports = [
./bluetooth.nix ./bluetooth.nix
./ergodox.nix ./ergodox.nix
./networking.nix
]; ];
} }

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.my.networking; cfg = config.my.hardware.networking;
in in
{ {
options.my.networking = with lib; { options.my.hardware.networking = with lib; {
externalInterface = mkOption { externalInterface = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;

View file

@ -18,7 +18,7 @@ let
in in
lib.filterAttrs shouldConnectToPeer allOthers; lib.filterAttrs shouldConnectToPeer allOthers;
extIface = config.my.networking.externalInterface; extIface = config.my.hardware.networking.externalInterface;
mkInterface = clientAllowedIPs: { mkInterface = clientAllowedIPs: {
listenPort = cfg.port; listenPort = cfg.port;