nixos/cri-o: add networkDir option

The new option can be used to specify the network directory for CNI
plugin configurations.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
Sascha Grunert 2020-09-16 11:44:27 +02:00 committed by zowoq
parent f9666eb863
commit eac4389021

View File

@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let let
cfg = config.virtualisation.cri-o; cfg = config.virtualisation.cri-o;
@ -78,6 +77,13 @@ in
The final CRI-O package (including extra packages). The final CRI-O package (including extra packages).
''; '';
}; };
networkDir = mkOption {
type = types.nullOr types.path;
default = null;
description = "Override the network_dir option.";
internal = true;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -95,6 +101,7 @@ in
[crio.network] [crio.network]
plugin_dirs = ["${pkgs.cni-plugins}/bin/"] plugin_dirs = ["${pkgs.cni-plugins}/bin/"]
${optionalString (cfg.networkDir != null) ''network_dir = "${cfg.networkDir}"''}
[crio.runtime] [crio.runtime]
cgroup_manager = "systemd" cgroup_manager = "systemd"