In my NixOS configuration.nix I have Gnome NetworkManager L2TP.
Gnome NetworkManager L2TP depends on StrongSwan. I want to override the StrongSwan derivation, and have Gnome NetworkManager L2TP use the overridden derivation. How do I do that? Something like this? This doesn’t seem to be working.
What you’re trying should work. Though it’s probably not advisable to override strongswan globally as that might results in lots of unnecessary rebuilds of packages other than l2tp.
I’d rather do
environment.systemPackages = with pkgs; [
(gnome.networkmanager-l2tp.override {
strongswan = pkgs.strongswan.overrideAttrs (old: {
postInstall = ''
# this is needed for l2tp
echo "include /etc/ipsec.d/*.secrets" >> $out/etc/ipsec.secrets
'';
});
})
];
Because this way, only gnome.networkmanager-l2tp depends on the overridden strongswan.
(Untested. You could also override gnome.networkmanager-l2tp in overlays the same way.)
If this is something all gnome.networkmanager-l2tp would benefit from, please bring the patch upstream into Nixpkgs!
I suspect that what’s happening here is that gnome.networkManager-l2tp is already overriding strongswan, so my own overrides to strongswan don’t get applied.