Commit 6651794
Changed files (2)
modules
roles
services
modules/roles/develop.nix
@@ -3,6 +3,8 @@
includes = with den.aspects; [
develop.binfmt
develop.direnv
+
+ services.podman
];
};
}
modules/services/podman.nix
@@ -0,0 +1,28 @@
+{lib, ...}: {
+ den.aspects.services.podman = {
+ nixos = {config, ...}: {
+ virtualisation.podman = {
+ enable = true;
+ dockerCompat = true;
+ dockerSocket.enable = true;
+ autoPrune.enable = true;
+ };
+
+ # Enable container name DNS for all Podman networks.
+ networking.firewall.interfaces = let
+ matchAll =
+ if !config.networking.nftables.enable
+ then "podman+"
+ else "podman*";
+ in {
+ "${matchAll}".allowedUDPPorts = [53];
+ };
+
+ virtualisation.oci-containers.backend = "podman";
+ };
+
+ user = {user, ...}: {
+ extraGroups = lib.optional (lib.elem "admins" user.groups) "podman";
+ };
+ };
+}