Files
nixos/hosts/fw.cloonar.com/modules/podman.nix
2023-12-01 12:02:38 +01:00

52 lines
1.2 KiB
Nix

{ pkgs, ... }:
let
json = pkgs.formats.json { };
in {
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings = {
driver = "macvlan";
network_interface = "server";
subnets = [
{
subnet = "10.42.97.0/24";
gateway = "10.42.97.1";
}
];
ipv6_enabled = false;
internal = false;
dns_enabled = false;
ipam_options = {
driver = "host-local";
};
};
};
};
systemd.sockets."io.podman.dhcp" = {
description = "DHCP Client for CNI";
socketConfig = {
ListenStream = "%t/cni/dhcp.sock";
SocketMode = 0600;
};
wantedBy = [ "sockets.target" ];
};
systemd.services."io.podman.dhcp" = {
description = "DHCP Client CNI Service";
after = [ "io.podman.dhcp.socket" ];
requires = [ "io.podman.dhcp.socket" ];
wantedBy = [ "multi-user.target" "io.podman.dhcp.socket" ];
path = [ pkgs.cni-plugins ];
serviceConfig = {
Type = "simple";
ExecStart= "${pkgs.cni-plugins}/bin/dhcp daemon";
TimeoutStopSec = 30;
KillMode = "process";
};
};
}