modules: hardware: move 'networking'

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

View file

@ -15,9 +15,11 @@
};
};
my.hardware.networking = {
# Which interface is used to connect to the internet
my.networking.externalInterface = "enp0s3";
externalInterface = "enp0s3";
# 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
my.networking.externalInterface = "eth0";
my.hardware.networking.externalInterface = "eth0";
}

View file

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

View file

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

View file

@ -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;

View file

@ -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;