nixos.virtualisation.containers: Init common /etc/containers configuration module

What's happening now is that both cri-o and podman are creating
/etc/containers/policy.json.

By splitting out the creation of configuration files we can make the
podman module leaner & compose better with other container software.
This commit is contained in:
adisbladis 2020-04-21 10:22:20 +01:00
commit 43f383c464
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
4 changed files with 157 additions and 119 deletions

View file

@ -62,9 +62,7 @@ in
log_level = "${cfg.logLevel}"
manage_network_ns_lifecycle = true
'';
environment.etc."containers/policy.json".text = ''
{"default": [{"type": "insecureAcceptAnything"}]}
'';
environment.etc."cni/net.d/20-cri-o-bridge.conf".text = ''
{
"cniVersion": "0.3.1",
@ -83,6 +81,9 @@ in
}
'';
# Enable common container configuration, this will create policy.json
virtualisation.containers.enable = true;
systemd.services.crio = {
description = "Container Runtime Interface for OCI (CRI-O)";
documentation = [ "https://github.com/cri-o/cri-o" ];