Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkManager allow disabling default plugins #365713

Closed
jalil-salame opened this issue Dec 16, 2024 · 2 comments
Closed

NetworkManager allow disabling default plugins #365713

jalil-salame opened this issue Dec 16, 2024 · 2 comments
Labels
0.kind: bug Something is broken

Comments

@jalil-salame
Copy link
Contributor

Describe the bug

NetworkManager has a set of default plugins that are enabled:

networkmanager.plugins = with pkgs; [
networkmanager-fortisslvpn
networkmanager-iodine
networkmanager-l2tp
networkmanager-openconnect
networkmanager-openvpn
networkmanager-vpnc
networkmanager-sstp
];

These cannot be disabled through the configuration of the module (e.g. to reduce the NixOS image size).

Steps To Reproduce

N/A

Expected behavior

The module should instead add the plugins to the networking.networkmanager.plugins option. That way they can be turned off if desired:

plugins = mkOption {
type =
let
networkManagerPluginPackage = types.package // {
description = "NetworkManager plug-in";
check =
p:
lib.assertMsg
(types.package.check p
&& p ? networkManagerPlugin
&& lib.isString p.networkManagerPlugin)
''
Package ‘${p.name}’, is not a NetworkManager plug-in.
Those need to have a ‘networkManagerPlugin’ attribute.
'';
};
in
types.listOf networkManagerPluginPackage;
default = [ ];
description = ''
List of NetworkManager plug-ins to enable.
Some plug-ins are enabled by the NetworkManager module by default.
'';
};

Additional context

NetworkManager's OpenConnect plugin adds about 150MiB to my NixOS image and I don't need it so I was looking to remove it.

Metadata

nix run nixpkgs#nix-info -- -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.63, NixOS, 24.11 (Vicuna), 24.11.20241213.314e12b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.91.1
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/jalil/.config/nix/nix.conf:/nix/store/b4q6s25biicxjzxvgqxx5hqc928ira1j-stylix-kde-config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/jalil/.local/share/flatpak/exports/etc/xdg/nix/nix.conf:/var/lib/flatpak/exports/etc/xdg/nix/nix.conf:/home/jalil/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/jalil/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/jalil/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/5fpjpa356qcpljidymbalqxq47yjp9lm-lix-2.91.1/share`
 - nixpkgs: `/nix/store/0xbni69flk8380w0apw4h640n37wn1i9-source

Notify maintainers

@jtojnar


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@jalil-salame jalil-salame added the 0.kind: bug Something is broken label Dec 16, 2024
@jtojnar
Copy link
Member

jtojnar commented Dec 17, 2024

See #137338 and #164531

@jalil-salame
Copy link
Contributor Author

Thanks!

Tl;dr: if you want to disable NetworkManager's default plugins, do this:

{
  networking.networkmanager.plugins = lib.mkForce [ ];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants