main
1{
2 den.aspects.services.podman = {
3 cache = {
4 directories = [
5 "/var/lib/containers"
6 ];
7 };
8
9 nixos = {config, ...}: {
10 virtualisation.podman = {
11 enable = true;
12 dockerCompat = true;
13 dockerSocket.enable = true;
14 autoPrune.enable = true;
15 };
16
17 # Enable container name DNS for all Podman networks.
18 networking.firewall.interfaces = let
19 matchAll =
20 if !config.networking.nftables.enable
21 then "podman+"
22 else "podman*";
23 in {
24 "${matchAll}".allowedUDPPorts = [53];
25 };
26
27 virtualisation.oci-containers.backend = "podman";
28 };
29
30 provides.to-users = {
31 includes = [
32 {
33 cacheHome = {config, ...}: {
34 directories = [
35 "${config.xdg.data.directory}/containers"
36 ];
37 };
38 }
39 ];
40
41 user = {
42 extraGroups = ["podman"];
43 };
44 };
45 };
46}