mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Networking] Add option to set dns backend, and use iwd as default wifi backend
This commit is contained in:
parent
fd8a893f9c
commit
e85b162511
1 changed files with 16 additions and 1 deletions
17
network.nix
17
network.nix
|
|
@ -18,6 +18,12 @@ in
|
|||
description = "Set network backend";
|
||||
type = types.enum [ "systemd-networkd" "NetworkManager" "dhcpcd" ];
|
||||
};
|
||||
dns = mkOption {
|
||||
default = "systemd-resolved";
|
||||
example = "dnsmasq";
|
||||
description = "Set network DNS";
|
||||
type = types.enum [ "systemd-resolved" "dnsmasq" ];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -25,7 +31,16 @@ in
|
|||
networking.networkmanager.enable = (cfg.backend == "NetworkManager");
|
||||
networking.dhcpcd.enable = (cfg.backend == "dhcpcd");
|
||||
|
||||
# networking.networkmanager.wifi.backend = mkDefault "iwd";
|
||||
|
||||
services.resolved.enable = (cfg.dns == "systemd-resolved");
|
||||
|
||||
networking.networkmanager = {
|
||||
wifi.backend = mkDefault "iwd";
|
||||
dns = mkDefault cfg.dns;
|
||||
packages = with pkgs; concatLists [
|
||||
(optional (cfg.dns == "dnsmasq") dnsmasq)
|
||||
];
|
||||
};
|
||||
networking.wireless.enable = (cfg.backend != "NetworkManager");
|
||||
|
||||
# Must always be false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue