2022-01-12 18:22:43 +01:00
|
|
|
# Podman related settings
|
2023-05-03 18:53:18 +02:00
|
|
|
{ config, lib, ... }:
|
2022-01-12 18:22:43 +01:00
|
|
|
let
|
|
|
|
cfg = config.my.system.podman;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.system.podman = with lib; {
|
|
|
|
enable = mkEnableOption "podman configuration";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2023-06-11 17:23:31 +02:00
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = cfg.enable -> !config.my.system.docker.enable;
|
|
|
|
message = ''
|
|
|
|
`config.my.system.podman` is incompatible with
|
|
|
|
`config.my.system.docker`.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2022-01-12 18:22:43 +01:00
|
|
|
virtualisation.podman = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# Use fake `docker` command to redirect to `podman`
|
|
|
|
dockerCompat = true;
|
|
|
|
|
|
|
|
# Expose a docker-like socket
|
|
|
|
dockerSocket.enable = true;
|
|
|
|
|
|
|
|
# Allow DNS resolution in the default network
|
2023-06-08 13:58:47 +02:00
|
|
|
defaultNetwork.settings = {
|
|
|
|
dns_enabled = true;
|
|
|
|
};
|
2023-06-08 13:25:05 +02:00
|
|
|
|
|
|
|
# Remove unused data on a weekly basis
|
|
|
|
autoPrune = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
dates = "weekly";
|
|
|
|
|
|
|
|
flags = [
|
|
|
|
"--all"
|
|
|
|
];
|
|
|
|
};
|
2022-01-12 18:22:43 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|