mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19:09 +02:00
feat[server]: add home proxy
This commit is contained in:
parent
75891c3103
commit
c1c7431891
84 changed files with 2961 additions and 1601 deletions
38
modules/nixos/server/podman.nix
Normal file
38
modules/nixos/server/podman.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
serviceName = "podman";
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselmodules.server.${serviceName} {
|
||||
|
||||
virtualisation = {
|
||||
podman.enable = true;
|
||||
oci-containers.backend = "podman";
|
||||
};
|
||||
|
||||
networking.nftables.firewall = lib.mkIf config.networking.nftables.enable {
|
||||
|
||||
zones.podman = {
|
||||
interfaces = [ "podman0" ];
|
||||
};
|
||||
|
||||
rules = {
|
||||
podman-to-postgres = lib.mkIf config.services.postgresql.enable {
|
||||
from = [ "podman" ];
|
||||
to = [ "local" ];
|
||||
before = [ "drop" ];
|
||||
allowedTCPPorts = [ config.services.postgresql.settings.port ];
|
||||
};
|
||||
|
||||
local-to-podman = {
|
||||
from = [ "local" "wgProxy" "wgHme" ];
|
||||
to = [ "podman" ];
|
||||
before = [ "drop" ];
|
||||
verdict = "accept";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue