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: tiny cleanups #15560

Merged
merged 1 commit into from Sep 23, 2019
Merged

Conversation

peterhoeg
Copy link
Member

This adds support for specifying the dhcp and dns options to networkmanager. It just follows upstream's defaults if not specified.

Especially the dns part is interesting as it allows us to do split lookups when connected to a VPN.

The dhcp technically allows us not to pull in dhclient or dhcpcd as it can use the internal library, but this hasn't been done yet.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @lethalman, @rickynils and @nmikhailov to be potential reviewers

@peterhoeg
Copy link
Member Author

cc @joachifm

@@ -132,6 +134,22 @@ in {
apply = list: (attrValues cfg.basePackages) ++ list;
};

dhcp = mkOption {
type = types.enum [ "dhclient" "dhcpcd" "internal" ];
default = "dhclient";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use internal as the default?

Copy link
Member Author

@peterhoeg peterhoeg May 20, 2016

Choose a reason for hiding this comment

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

Upstream's default is dhclient and dhcp is being pulled in as a dependency anyway. Next phase should be to not have to pull those in ref my commit note.

@joachifm
Copy link
Contributor

I don't use NetworkManager, so perhaps this is obvious, but what happens if I set dns = "unbound" without doing anything else? What does NetworkManager assume about the environment in that case?

@peterhoeg
Copy link
Member Author

My guess is that networkmanager will assume that unbound is available and probably fail in a very non-graceful manner. Updating PR.

@peterhoeg
Copy link
Member Author

Actually, it totally doesn't work with unbound as there are some expectations about script locations that break. So one way to deal with this is simply to not support unbound until that gets fixed. Thoughts @joachifm ?

@joachifm
Copy link
Contributor

Generally, I think its okay to not support the full range of values the underlying daemon accepts, as long as this is clearly communicated and/or invalid states are eliminated via asserts. I wonder whether the interface is too crude, though.

Primarily, it's unclear to me how these options interact with the corresponding services NixOS provides. Like, if I use both the NixOS dnsmasq service and set dns = "dnsmasq", what does that mean? Will NetworkManager spawn its own processes or what?

As a prospective user, I'd care more about features than implementations; without knowing what each does, the choice between dnsmasq and unbound or dhclient and dhcpcd becomes quite meaningless, IMO.

Anyway, it'd be better to get some feedback from actual users of NetworkManager ... maybe all this makes perfect sense, but it really doesn't to me.

@FlorentBecker
Copy link
Contributor

Is there any consensus on what the user-facing solution should look like? If not, should we close this?

@peterhoeg
Copy link
Member Author

peterhoeg commented Feb 13, 2017 via email

${optionalString (cfg.unmanaged != [])
''unmanaged-devices=${lib.concatStringsSep ";" cfg.unmanaged}''}

[logging]
level=WARN
level=${cfg.logLevel}
audit=${if config.security.audit.enable then "true" else "false"}
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this patch has already been integrated into master. Except for this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch. There the audit bit as well as dbus config for dnsmasq.

Copy link
Member

Choose a reason for hiding this comment

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

Yup

These are the leftovers of an older PR.

a. Send messages to auditd if auditing is enabled.
b. Add missing dbus configuration if dnsmasq is used for DNS
@peterhoeg peterhoeg changed the title networkmanager module: support for dns and dhcp options nixos/networkmanager: tiny cleanups Sep 22, 2019
@peterhoeg peterhoeg merged commit 423eb16 into NixOS:master Sep 23, 2019
@peterhoeg peterhoeg deleted the nm_dnsdhcp branch September 23, 2019 03:39
@peterhoeg peterhoeg restored the nm_dnsdhcp branch September 23, 2019 08:21
@peterhoeg peterhoeg deleted the nm_dnsdhcp branch September 23, 2019 17:04
@peterhoeg peterhoeg restored the nm_dnsdhcp branch September 24, 2019 20:28
@peterhoeg peterhoeg deleted the nm_dnsdhcp branch September 24, 2019 20:41
@peterhoeg peterhoeg restored the nm_dnsdhcp branch September 24, 2019 22:13
@peterhoeg peterhoeg deleted the nm_dnsdhcp branch September 26, 2019 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants