2024-12-15 17:22:36 -06:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.containers;
|
|
|
|
in {
|
|
|
|
options.containers = {
|
|
|
|
podman = {
|
|
|
|
enable = lib.mkEnableOption "Podman container runtime";
|
|
|
|
dockerCompat = lib.mkEnableOption "Enable Docker compatibility";
|
|
|
|
extraPackages = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.package;
|
|
|
|
default = [];
|
|
|
|
description = "Additional packages to install when Podman is enabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-12-15 21:37:43 -06:00
|
|
|
config = lib.mkIf cfg.enable (lib.attrsets.optionalAttrs (config.nixpkgs.hostPlatform.isLinux) {
|
|
|
|
virtualisation.podman = {
|
|
|
|
enable = true;
|
|
|
|
dockerCompat = cfg.dockerCompat;
|
|
|
|
enableOnBoot = true;
|
|
|
|
defaultNetwork.settings.dns_enabled = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// {
|
|
|
|
environment.systemPackages =
|
|
|
|
[
|
|
|
|
pkgs.podman-compose
|
|
|
|
pkgs.buildah
|
|
|
|
pkgs.skopeo
|
|
|
|
pkgs.dive
|
|
|
|
pkgs.container-diff
|
|
|
|
]
|
|
|
|
++ cfg.extraPackages;
|
|
|
|
});
|
2024-12-12 19:41:58 -06:00
|
|
|
}
|