From f28df17dfa98b32737bd309e71d7ca04bf6722e7 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 27 May 2021 13:00:09 +0200 Subject: [PATCH] nixos/containers: Add virtualisation.containers.containersConf.cniPlugins (cherry picked from commit efba949352271ec77d9d5e7d54f2d16b9c53ee4f) --- nixos/modules/virtualisation/containers.nix | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 3974caf2233..45d4f877ae5 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -48,6 +48,23 @@ in description = "containers.conf configuration"; }; + containersConf.cniPlugins = mkOption { + type = types.listOf types.package; + defaultText = '' + [ + pkgs.cni-plugins + ] + ''; + example = lib.literalExample '' + [ + pkgs.cniPlugins.dnsname + ] + ''; + description = '' + CNI plugins to install on the system. + ''; + }; + registries = { search = mkOption { type = types.listOf types.str; @@ -97,8 +114,11 @@ in }; config = lib.mkIf cfg.enable { + + virtualisation.containers.containersConf.cniPlugins = [ pkgs.cni-plugins ]; + virtualisation.containers.containersConf.settings = { - network.cni_plugin_dirs = [ "${pkgs.cni-plugins}/bin/" ]; + network.cni_plugin_dirs = map (p: "${lib.getBin p}/bin") cfg.containersConf.cniPlugins; engine = { init_path = "${pkgs.catatonit}/bin/catatonit"; } // lib.optionalAttrs cfg.ociSeccompBpfHook.enable {