I have this in my /etc/nixos/configuration.nix:
networking.networkmanager.ensureProfiles.profile.<name>.ipv4."never-default" = "yes"
But it seems it’s silently ignored. Looking at the profile in nmcli, even after deleting and recreating it with nixos-rebuild switch always shows:
ipv4.never-default: no
Did I do something wrong here or is that a bug in NixOS?
For now as a workaround I’ve switched to configure the network manager profiles in which I require the “never-default” directive via:
environment.etc."NetworkManager/system-connections/<name>.nmconnection"