mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-15 05:39:11 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
48
modules-clone/nixos/server/podman.nix
Normal file
48
modules-clone/nixos/server/podman.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ config, lib, confLib, ... }:
|
||||
let
|
||||
serviceName = "podman";
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselmodules.server.${serviceName} {
|
||||
|
||||
users.persistentIds = {
|
||||
podman = confLib.mkIds 969;
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
podman.enable = true;
|
||||
oci-containers.backend = "podman";
|
||||
};
|
||||
|
||||
environment.persistence."/state" = lib.mkIf config.swarselsystems.isMicroVM {
|
||||
directories = [
|
||||
{ directory = "/var/lib/containers"; }
|
||||
];
|
||||
};
|
||||
|
||||
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" "wgHome" ];
|
||||
to = [ "podman" ];
|
||||
before = [ "drop" ];
|
||||
verdict = "accept";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue