From c968d007670a354cb97919112a7307692664285a Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 21 Dec 2024 20:46:27 +0100 Subject: [PATCH] Add option for networkmanager configuration. --- config/networking.nix | 2 +- config/networkmanager.nix | 26 ++++++++++++++++++++++++++ config/users.nix | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 config/networkmanager.nix diff --git a/config/networking.nix b/config/networking.nix index b26903d..46fa33e 100644 --- a/config/networking.nix +++ b/config/networking.nix @@ -7,7 +7,7 @@ with lib; let inherit (config.machine) networkD; in -{ +mkIf (!elem "networkmanager" config.machine.conffiles) { networking = { inherit (config.machine) hostName; useNetworkd = networkD.enable; diff --git a/config/networkmanager.nix b/config/networkmanager.nix new file mode 100644 index 0000000..b57cda9 --- /dev/null +++ b/config/networkmanager.nix @@ -0,0 +1,26 @@ +{ + pkgs, + config, + lib, + ... +}: + +with lib; +mkIf (elem "networkmanager" config.machine.conffiles) { + + networking = { + inherit (config.machine) hostName; + }; + + networking.networkmanager = { + enable = true; + plugins = with pkgs; [ + networkmanager-openconnect + ]; + }; + + environment.systemPackages = with pkgs; [ + networkmanagerapplet + networkmanager_dmenu + ]; +} diff --git a/config/users.nix b/config/users.nix index 71b83f2..dd1245a 100644 --- a/config/users.nix +++ b/config/users.nix @@ -48,6 +48,7 @@ let ]) ++ (optional config.programs.virt-manager.enable "libvirtd") ++ (optional config.virtualisation.virtualbox.host.enable "vboxusers") + ++ (optional config.networking.networkmanager.enable "networkmanager") ++ (optional (withDocker && !withPodman) "docker") ++ (optional withPodman "podman"); shell = "${pkgs.zsh}/bin/zsh";