43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
# Containers pack — Docker + Podman.
|
|
#
|
|
# Unifies the docker config that was previously split between core.nix
|
|
# (basic enable + weekly autoPrune) and development.nix (daemon.settings
|
|
# buildkit + registry-mirror + autoPrune --all), plus the podman block
|
|
# that lived coding-gated in development.nix. Now a single source of truth
|
|
# gated on omni.packs.containers.enable. (The merged result is the union
|
|
# of the two old blocks — identical on any host that had both features on,
|
|
# e.g. omni.)
|
|
{ config, lib, ... }:
|
|
let
|
|
cfg = config.omni.packs.containers;
|
|
in
|
|
{
|
|
options.omni.packs.containers.enable =
|
|
lib.mkEnableOption "Containers pack (Docker + Podman)";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
virtualisation.docker = {
|
|
enable = true;
|
|
enableOnBoot = true;
|
|
daemon.settings = {
|
|
features = {
|
|
buildkit = true;
|
|
};
|
|
registry-mirrors = [ "https://mirror.gcr.io" ];
|
|
};
|
|
|
|
autoPrune = {
|
|
enable = true;
|
|
dates = "weekly";
|
|
flags = [ "--all" ];
|
|
};
|
|
};
|
|
|
|
# Podman as Docker alternative (dockerCompat off to avoid conflict).
|
|
virtualisation.podman = {
|
|
enable = true;
|
|
dockerCompat = false;
|
|
defaultNetwork.settings.dns_enabled = true;
|
|
};
|
|
};
|
|
}
|