nixos,networking: add myFlake.nixos.networking.network-configuration-daemon
This commit is contained in:
parent
6115991804
commit
112ae500c3
5 changed files with 32 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./dns.nix
|
||||
./iwd.nix
|
||||
./network-configuration-daemon.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{lib, ...}: {
|
||||
networking.wireless.iwd.enable = lib.mkDefault true;
|
||||
}
|
31
nixos/networking/network-configuration-daemon.nix
Normal file
31
nixos/networking/network-configuration-daemon.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.nixos.networking.network-configuration-daemon;
|
||||
in {
|
||||
options = {
|
||||
myFlake.nixos = {
|
||||
networking = {
|
||||
network-configuration-daemon = lib.mkOption {
|
||||
type = lib.types.enum ["iwd" "networkmanager" "networkmanager-iwd"];
|
||||
default = "iwd";
|
||||
example = "networkmanager";
|
||||
description = "Select network configuration daemon";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
networking.wireless.iwd.enable = lib.mkIf (cfg == "iwd" || cfg == "networkmanager-iwd") true;
|
||||
|
||||
networking.networkmanager = lib.mkIf (cfg == "networkmanager" || cfg == "networkmanager-iwd") {
|
||||
enable = true;
|
||||
ethernet.macAddress = "random";
|
||||
wifi.macAddress = "random";
|
||||
wifi.backend = lib.mkIf (cfg == "networkmanager-iwd") "iwd";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{...}: {
|
||||
networking.networkmanager = {
|
||||
enable = true;
|
||||
wifi.backend = "iwd";
|
||||
ethernet.macAddress = "random";
|
||||
wifi.macAddress = "random";
|
||||
};
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{...}: {
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
ethernet.macAddress = "random";
|
||||
wifi.macAddress = "random";
|
||||
};
|
||||
wireless.iwd.enable = false;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue