I have tried a number of permutations but haven’t found the right one… Can someone tell me what ‘networking.networkmanager.connectionConfig’ expects please?
error: A definition for option `networking.networkmanager.connectionConfig."/org/freedesktop/NetworkManager/Settings/0"' is not of type `null or boolean or signed integer or string'. Definition values:
- In `/mnt/etc/nixos/configuration.nix':
{
ipv6 = {
method = "disabled";
};
}
I am guessing my error is within ipv6.method = "disabled" which I based on nmcli connection modify "Wired connection 1" ipv6.method "disabled" which works from the console. The valid options listed are [ignore, auto, dhcp, link-local, manual, shared, disabled].
FWIW nmcli connection modify "/org/freedesktop/NetworkManager/Settings/2" ipv6.method "disabled" also works from the command line. (this is slightly confusing given the last number is supposed to be an index value and 1 is the loopback and there are only 2 interfaces in the configuration! )
That option is just for settings written to /etc/NetworkManager/NetworkManager.conf in [connection] section.
And it’s a “flat” attrset (lhs is a name, rhs is null/bool/int/string), ie:
What this seems to do is add the following to /etc/NetworkManager/NetworkManager.conf
[connection]
ipv6.method=disabled
I haven’t been able to find out much about what this is supposed to do in this file. I’d sort of expect it to either disable IPv6 altogether which it doesn’t appear to do as interfaces are still showing an IPv6 address even after a service restart. The other option is that ‘new’ connections start with IPv6 disabled which also doesn’t appear to be what actually happens.
The state of IPv6 for an individual connection does seem to be correctly reflected in /etc/NetworkManager/system-connections/<Connection Name>.nmconnection
[ipv6]
method=disabled
Choices; networking.networkmanager.settings seems to also work on /etc/NetworkManager/NetworkManager.conf so I’m not sure if I can achieve what I want that way.
networking.networkmanager.ensureProfiles.profiles let me declare a new network connection and I can set the IPv6 method in there, but it seems this won’t or can’t edit or replace the default connection that is created and I haven’t found a way to stop it being created yet.
It looks like I could overwrite the existing default file using environment.etc