nix/nixos/hosts/framework-server/containers.nix

21 lines
662 B
Nix
Raw Normal View History

2024-03-26 03:35:38 +01:00
{ config, lib, self, inputs, outputs, stateVersion, hmStateVersion, ... }:
2024-03-20 09:23:30 +01:00
let
2024-03-25 03:53:39 +01:00
libx = import ../../../lib { inherit lib self inputs outputs stateVersion hmStateVersion; };
2024-03-26 03:35:38 +01:00
lanInterface = "enp0s13f0u4";
2024-03-20 09:23:30 +01:00
in {
containers = {
2024-03-26 01:00:46 +01:00
rdesktop = libx.mkContainer { hostname = "rdesktop"; };
2024-03-20 09:23:30 +01:00
};
2024-03-26 01:00:46 +01:00
2024-03-26 03:35:38 +01:00
networking.firewall.extraCommands = ''
iptables -w -t nat -A nixos-nat-post -s ${config.containers.rdesktop.localAddress} -j MASQUERADE
'';
2024-03-26 01:00:46 +01:00
2024-03-26 03:35:38 +01:00
networking.nat = {
enable = true;
internalInterfaces = [ "ve-rdesktop" ];
externalInterface = lanInterface;
extraCommands = "iptables -t nat -A POSTROUTING -o ${lanInterface} -j MASQUERADE";
2024-03-26 01:00:46 +01:00
};
2024-03-21 12:27:53 +01:00
}