change podman config

This commit is contained in:
2023-12-01 10:56:35 +01:00
parent 7580f897c2
commit 3ebbe5d7d4
5 changed files with 48 additions and 31 deletions

View File

@@ -0,0 +1,47 @@
{ pkgs, ... }: {
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings = {
cniVersion = "0.4.0";
name = "newnet";
plugins = [
{
type = "macvlan";
master = "server";
pam = {
type = "dhcp";
};
}
];
};
};
};
systemd.sockets."io.podman.dhcp" = {
description = "DHCP Client for CNI";
socketConfig = {
ListenStreams = "%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" ];
also = "io.podman.dhcp.socket";
path = [ pkgs.cni-plugins ];
serviceConfig = {
Type = "simple";
ExecStart= "${pkgs.cni-plugins}/bin/dhcp daemon";
TimeoutStopSec = 30;
KillMode = "process";
};
};
}