2021-06-04 09:07:49 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
mkOption
|
|
|
|
mkIf
|
|
|
|
types
|
|
|
|
;
|
|
|
|
|
|
|
|
cfg = config.virtualisation.podman;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
virtualisation.podman = {
|
|
|
|
|
|
|
|
defaultNetwork.dnsname.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2021-06-04 09:07:49 +00:00
|
|
|
Enable DNS resolution in the default podman network.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
virtualisation.containers.containersConf.cniPlugins = mkIf cfg.defaultNetwork.dnsname.enable [ pkgs.dnsname-cni ];
|
|
|
|
virtualisation.podman.defaultNetwork.extraPlugins =
|
|
|
|
lib.optional cfg.defaultNetwork.dnsname.enable {
|
|
|
|
type = "dnsname";
|
|
|
|
domainName = "dns.podman";
|
|
|
|
capabilities.aliases = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|