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

nixos/networkmanager: make all plugins optional #84433

Closed
wants to merge 1 commit into from

Conversation

lovesegfault
Copy link
Member

Motivation for this change

This solves an issue with the current NetworkManager module where it's
impossible to use it on a system with environment.noXlibs = true due
to failures in some plugin builds.

Moreover, these are entirely optional and not crucial to having NM
working and I suspect most don't really need all, possibly any, of these
that were built-in.

I also attempted to clean up plugin-related side effects that weren't
within an "if cfg..." guard, again to minimize the default footprint of
the NM module.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Unsure how I should test this, tagging my usual review frens: @worldofpeace @cole-h @flokli @andir

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Apr 6, 2020
@lovesegfault
Copy link
Member Author

Missed @jtojnar since they're on the FreeDesktop team too.

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording nits.

nixos/modules/services/networking/networkmanager.nix Outdated Show resolved Hide resolved
@jtojnar
Copy link
Member

jtojnar commented Apr 6, 2020

What error does it produce with noXlibs?

@lovesegfault
Copy link
Member Author

@jtojnar https://gist.github.com/70307b66431dbba4d125ae48f3f060cc

This is one, others fail too with the same error.

@@ -325,16 +318,75 @@ in {
'';
};

enableFortiSSL = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might even just remove the VPN plug-ins from basePackages and let users install the VPN providers manually to netowrk-manager.packages. And using passthru to let users know what files to link to environment.etc and tmpfiles.d (I think there should be a way to make these unnecessary but we can leave that for the future.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current state this PR already removes all VPN plugins from the (now-gone) basePackages. they get added and configured conditionally on their respective options.

I think this is superior, even if more repetitive on our end, then making the user fiddle with passthru.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer would set the passthru for each plug-in and user would just use netowrk-manager.packages = [ nm-foovpn … ];.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: tmpfiles.d #40594

Copy link
Contributor

@worldofpeace worldofpeace Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda like that @jtojnar. But the thing here with making them all optional, they're currently all off by default and that's going to break existing setups that might have relied on it. So we'd have to add a default set to network-manager.packages, and I guess some sort of excludedPackages thing, with all the default plugins in relatedPackages so users know which one's are there default.

I think having the plugins in a list would make sense.
Should we name it network-manager.plugins?

But if we decide to have an option per plugin, we need to have all the plugins that were in basePackages to be default true.

Copy link
Member

@jtojnar jtojnar Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see a problem with changing defaults, as long as it is properly documented in release notes. We should not have made the option so fat by default in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't get too verbose to use, I'd also prefer having a list like network-manager.[packages|plugins] over adding tons of options.

👍 on @jtojnar - we can ship less plugins by defaults, if it's properly covered in the release notes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disapprove of this because it isn't a seamless transition. Usually if someone has something installed or configured they'd want this to stay that way. Not to mention we'd probably cause users headache's on nixos-unstable.

This PR will also have to re-add the disabled plugins for many of the desktop manager's that make inferences that these plugins are already there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But as mentioned by @jtojnar, we have to add information to the respective packages in passthru that is done intricately here already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about these two comments.

  • I think doing these changes is fine if they're documented in the release notes.
  • Desktop Environments like plasma and gnome shell could add them (and even if they wouldn't, I think they kinda enumerate the available plugins installed)

This solves an issue with the current NetworkManager module where it's
impossible to use it on a system with `environment.noXlibs = true` due
to failures in some plugin builds.

Moreover, these are entirely optional and not crucial to having NM
working and I suspect most don't really need all, possibly any, of these
that were built-in.

I also attempted to clean up plugin-related side effects that weren't
within an "if cfg..." guard, again to minimize the default footprint of
the NM module.
@stale
Copy link

stale bot commented Oct 3, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 11, 2020
@flokli
Copy link
Contributor

flokli commented Oct 11, 2020

I think a smaller variant of networkmanager would be useful - like having a headless system, but with NetworkManager as a network manager.

We could ensure "common desktop workloads" still work as expected by enabling the plugins from the desktop environments.

@lovesegfault
Copy link
Member Author

I'm abandoning this for now. Should still be fixed in the future.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/networkmanager-plugins-installed-by-default/39682/8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants