diff options
Diffstat (limited to 'nixpkgs/nixos/modules/virtualisation/podman-dnsname.nix')
-rw-r--r-- | nixpkgs/nixos/modules/virtualisation/podman-dnsname.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/virtualisation/podman-dnsname.nix b/nixpkgs/nixos/modules/virtualisation/podman-dnsname.nix new file mode 100644 index 000000000000..beef19755079 --- /dev/null +++ b/nixpkgs/nixos/modules/virtualisation/podman-dnsname.nix @@ -0,0 +1,36 @@ +{ 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; + description = '' + 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; + }; + }; +} |