networkmanager: Add rc-manager option
Add an option to set the rc-manager parameter in NetworkManager.conf, which controls how NetworkManager handles resolv.conf. This sets the default rc-manager to "resolvconf", which solves #61490. It additionally allows the user to change rc-manager without interference from configuration activations.
This commit is contained in:
parent
2850832e67
commit
80acb28bee
@ -309,8 +309,11 @@ in
|
|||||||
ln -s /run/systemd/resolve/resolv.conf /run/resolvconf/interfaces/systemd
|
ln -s /run/systemd/resolve/resolv.conf /run/resolvconf/interfaces/systemd
|
||||||
''}
|
''}
|
||||||
|
|
||||||
# Make sure resolv.conf is up to date if not managed manually or by systemd
|
# Make sure resolv.conf is up to date if not managed manually, by systemd or
|
||||||
${optionalString (!config.environment.etc?"resolv.conf") ''
|
# by NetworkManager
|
||||||
|
${optionalString (!config.environment.etc?"resolv.conf" &&
|
||||||
|
(cfg.networkmanager.enable ->
|
||||||
|
cfg.networkmanager.rc-manager == "resolvconf")) ''
|
||||||
${pkgs.openresolv}/bin/resolvconf -u
|
${pkgs.openresolv}/bin/resolvconf -u
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
@ -17,6 +17,7 @@ let
|
|||||||
plugins=keyfile
|
plugins=keyfile
|
||||||
dhcp=${cfg.dhcp}
|
dhcp=${cfg.dhcp}
|
||||||
dns=${cfg.dns}
|
dns=${cfg.dns}
|
||||||
|
rc-manager=${cfg.rc-manager}
|
||||||
|
|
||||||
[keyfile]
|
[keyfile]
|
||||||
${optionalString (cfg.unmanaged != [])
|
${optionalString (cfg.unmanaged != [])
|
||||||
@ -283,6 +284,25 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rc-manager = mkOption {
|
||||||
|
type = types.enum [ "symlink" "file" "resolvconf" "netconfig" "unmanaged" "none" ];
|
||||||
|
default = "resolvconf";
|
||||||
|
description = ''
|
||||||
|
Set the <literal>resolv.conf</literal> management mode.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
A description of these modes can be found in the main section of
|
||||||
|
<link xlink:href="https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html">
|
||||||
|
https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html
|
||||||
|
</link>
|
||||||
|
or in
|
||||||
|
<citerefentry>
|
||||||
|
<refentrytitle>NetworkManager.conf</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum>
|
||||||
|
</citerefentry>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
dispatcherScripts = mkOption {
|
dispatcherScripts = mkOption {
|
||||||
type = types.listOf (types.submodule {
|
type = types.listOf (types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user