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:
parent
f9666eb863
commit
eac4389021
@ -1,14 +1,13 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.virtualisation.cri-o;
|
cfg = config.virtualisation.cri-o;
|
||||||
|
|
||||||
crioPackage = (pkgs.cri-o.override { inherit (cfg) extraPackages; });
|
crioPackage = (pkgs.cri-o.override { inherit (cfg) extraPackages; });
|
||||||
|
|
||||||
# Copy configuration files to avoid having the entire sources in the system closure
|
# Copy configuration files to avoid having the entire sources in the system closure
|
||||||
copyFile = filePath: pkgs.runCommandNoCC (builtins.unsafeDiscardStringContext (builtins.baseNameOf filePath)) {} ''
|
copyFile = filePath: pkgs.runCommandNoCC (builtins.unsafeDiscardStringContext (builtins.baseNameOf filePath)) { } ''
|
||||||
cp ${filePath} $out
|
cp ${filePath} $out
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user