diff options
author | adisbladis <adisbladis@gmail.com> | 2020-05-04 15:22:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 15:22:49 +0200 |
commit | b1ae5f864a55d562c7f0126ddf891b8beaa6c1ce (patch) | |
tree | 2d5b8aaed5df5ce6dd37eba7f1911ecabf8996fb /nixos | |
parent | 44a43c99d8eb3cbc870f509fb5a0203d8cfba515 (diff) | |
parent | a44b3b6afc32849533052528c976c8e23ea7ed92 (diff) |
Merge pull request #86634 from zowoq/crio-upstream-config
nixos/cri-o: copy upstream config
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/cri-o.nix | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/nixos/modules/virtualisation/cri-o.nix b/nixos/modules/virtualisation/cri-o.nix index 89ba9c3c66365..2af4214302d69 100644 --- a/nixos/modules/virtualisation/cri-o.nix +++ b/nixos/modules/virtualisation/cri-o.nix @@ -4,6 +4,11 @@ with lib; let cfg = config.virtualisation.cri-o; + + # Copy configuration files to avoid having the entire sources in the system closure + copyFile = filePath: pkgs.runCommandNoCC (builtins.unsafeDiscardStringContext (builtins.baseNameOf filePath)) {} '' + cp ${filePath} $out + ''; in { imports = [ @@ -45,9 +50,9 @@ in config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ cri-o cri-tools conmon iptables runc utillinux ]; - environment.etc."crictl.yaml".text = '' - runtime-endpoint: unix:///var/run/crio/crio.sock - ''; + + environment.etc."crictl.yaml".source = copyFile "${pkgs.cri-o.src}/crictl.yaml"; + environment.etc."crio/crio.conf".text = '' [crio] storage_driver = "${cfg.storageDriver}" @@ -66,23 +71,7 @@ in manage_network_ns_lifecycle = true ''; - environment.etc."cni/net.d/20-cri-o-bridge.conf".text = '' - { - "cniVersion": "0.3.1", - "name": "crio-bridge", - "type": "bridge", - "bridge": "cni0", - "isGateway": true, - "ipMasq": true, - "ipam": { - "type": "host-local", - "subnet": "10.88.0.0/16", - "routes": [ - { "dst": "0.0.0.0/0" } - ] - } - } - ''; + environment.etc."cni/net.d/10-crio-bridge.conf".source = copyFile "${pkgs.cri-o.src}/contrib/cni/10-crio-bridge.conf"; # Enable common /etc/containers configuration virtualisation.containers.enable = true; |