2025-12-15 22:32:32 -05:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports = [ ];
|
|
|
|
|
|
|
|
|
|
options.me = {
|
|
|
|
|
containerd.enable = lib.mkOption {
|
|
|
|
|
type = lib.types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
example = true;
|
|
|
|
|
description = "Whether we want to install containerd.";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = lib.mkIf config.me.containerd.enable {
|
|
|
|
|
virtualisation.containerd.enable = true;
|
2025-12-16 21:07:39 -05:00
|
|
|
virtualisation.containerd.settings =
|
2025-12-18 00:27:18 -05:00
|
|
|
let
|
|
|
|
|
my-cni-plugins = pkgs.buildEnv {
|
|
|
|
|
name = "my-cni-plugins";
|
|
|
|
|
paths = with pkgs; [
|
|
|
|
|
cni-plugins
|
|
|
|
|
cni-plugin-flannel
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
in
|
2025-12-16 21:07:39 -05:00
|
|
|
{
|
|
|
|
|
"plugins" = {
|
|
|
|
|
"io.containerd.grpc.v1.cri" = {
|
|
|
|
|
"cni" = {
|
2025-12-18 00:27:18 -05:00
|
|
|
# "bin_dir" = "/opt/cni/bin";
|
|
|
|
|
"bin_dir" = "${my-cni-plugins}/bin";
|
|
|
|
|
# "conf_dir" = "/etc/cni/net.d";
|
|
|
|
|
"conf_dir" = "${pkgs.callPackage ./package/cni_conf/package.nix { }}";
|
2025-12-16 21:07:39 -05:00
|
|
|
};
|
|
|
|
|
"containerd" = {
|
|
|
|
|
"default_runtime_name" = "runc";
|
|
|
|
|
"runtimes" = {
|
|
|
|
|
"runc" = {
|
|
|
|
|
"options" = {
|
|
|
|
|
"SystemdCgroup" = true;
|
|
|
|
|
};
|
|
|
|
|
"runtime_type" = "io.containerd.runc.v2";
|
2025-12-15 22:32:32 -05:00
|
|
|
};
|
|
|
|
|
};
|
2025-12-16 21:07:39 -05:00
|
|
|
"snapshotter" = "overlayfs";
|
2025-12-15 22:32:32 -05:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-12-16 21:07:39 -05:00
|
|
|
"version" = 2;
|
2025-12-15 22:32:32 -05:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|