mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/podman-dnsname: init
This commit is contained in:
parent
d81631fb98
commit
54f2f1e5f1
5 changed files with 84 additions and 0 deletions
36
nixos/modules/virtualisation/podman-dnsname.nix
Normal file
36
nixos/modules/virtualisation/podman-dnsname.nix
Normal file
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -39,6 +39,7 @@ let
|
|||
in
|
||||
{
|
||||
imports = [
|
||||
./podman-dnsname.nix
|
||||
./podman-network-socket.nix
|
||||
(lib.mkRenamedOptionModule [ "virtualisation" "podman" "libpod" ] [ "virtualisation" "containers" "containersConf" ])
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue