Skip to content

Instantly share code, notes, and snippets.

@macros
Created March 1, 2022 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macros/ef20b110f80a6ee5dafcb6451f3d3885 to your computer and use it in GitHub Desktop.
Save macros/ef20b110f80a6ee5dafcb6451f3d3885 to your computer and use it in GitHub Desktop.
Miniupnpd with nftables override
# Rebuild the package with nftables support
# Module expects scripts named iptables_ so copy nft versions to those names
nixpkgs.config.packageOverrides = pkgs: {
miniupnpd = pkgs.miniupnpd.overrideAttrs (o:{
buildInputs = o.buildInputs ++ [ pkgs.libmnl pkgs.libnftnl pkgs.openssl ];
makefile = "Makefile.linux_nft";
configureFlags = [ "--firewall=nftables" ];
postFixup = ''
cp $out/etc/miniupnpd/nft_init.sh $out/etc/miniupnpd/iptables_init.sh
cp $out/etc/miniupnpd/nft_removeall.sh $out/etc/miniupnpd/iptables_removeall.sh
for script in $out/etc/miniupnpd/{nft,iptables}_{init,removeall}.sh
do
wrapProgram $script --set PATH '${scriptBinEnv}:$PATH'
done
'';
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment