2021-05-05 12:27:07 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
2021-05-29 16:41:59 +02:00
|
|
|
cfg = config.my.hardware.networking;
|
2021-05-05 12:27:07 +02:00
|
|
|
in
|
2021-02-18 01:08:35 +01:00
|
|
|
{
|
2021-05-29 16:41:59 +02:00
|
|
|
options.my.hardware.networking = with lib; {
|
2021-05-05 12:27:07 +02:00
|
|
|
externalInterface = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
example = "eth0";
|
|
|
|
description = ''
|
|
|
|
Name of the network interface that egresses to the internet. Used for
|
|
|
|
e.g. NATing internal networks.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
wireless = {
|
|
|
|
enable = mkEnableOption "wireless configuration";
|
|
|
|
};
|
2021-02-18 01:08:35 +01:00
|
|
|
};
|
2021-05-05 12:27:07 +02:00
|
|
|
|
|
|
|
config = lib.mkMerge [
|
|
|
|
(lib.mkIf cfg.wireless.enable {
|
|
|
|
networking.networkmanager.enable = true;
|
2021-10-22 14:06:03 +02:00
|
|
|
|
2024-11-28 23:01:38 +01:00
|
|
|
# IWD needs persistence if enabled
|
|
|
|
|
2021-10-22 14:06:03 +02:00
|
|
|
# Persist NetworkManager files
|
|
|
|
my.system.persist.files = [
|
|
|
|
"/var/lib/NetworkManager/secret_key"
|
|
|
|
"/var/lib/NetworkManager/seen-bssids"
|
|
|
|
"/var/lib/NetworkManager/timestamps"
|
|
|
|
];
|
|
|
|
my.system.persist.directories = [
|
|
|
|
"/etc/NetworkManager/system-connections"
|
|
|
|
];
|
2021-05-05 12:27:07 +02:00
|
|
|
})
|
|
|
|
];
|
2021-02-18 01:08:35 +01:00
|
|
|
}
|