nixos/hosts/common/optional/lxd/lxd-networking.nix

22 lines
501 B
Nix
Raw Normal View History

2024-06-29 14:40:10 +01:00
{ ... }:
let
lxd_profiles = {
"default" = (import ./profiles/default.nix);
};
in
{
boot = {
kernelModules = [ "nf_nat_ftp" ];
kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = true;
"net.ipv4.conf.default.forwarding" = true;
};
};
# allow static ipv4 for containers
networking.firewall.extraCommands = ''
2024-06-29 22:18:42 +01:00
iptables -A INPUT -i ${lxd_profiles.default.network.name} -m comment --comment "lxd rule for ${lxd_profiles.default.network.name}" -j ACCEPT
2024-06-29 14:40:10 +01:00
'';
}