summary refs log tree commit diff
path: root/nixos/modules/virtualisation
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2020-05-14 16:28:32 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2020-06-26 08:09:36 +1000
commite89446656d1edf9fac9e2e3552980e97e86155a5 (patch)
treee183bffa49ae3eca1292058436a57b9e046ca0e8 /nixos/modules/virtualisation
parent033ba9c73d4fe544db93fbf299cf7a4a0a786ea8 (diff)
downloadnixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.tar
nixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.tar.gz
nixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.tar.bz2
nixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.tar.lz
nixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.tar.xz
nixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.tar.zst
nixpkgs-e89446656d1edf9fac9e2e3552980e97e86155a5.zip
nixos/{podman,containers}: libpod.conf -> containers.conf
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r--nixos/modules/virtualisation/containers.nix25
-rw-r--r--nixos/modules/virtualisation/podman.nix28
2 files changed, 29 insertions, 24 deletions
diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix
index 7d184575640..105f0f2710e 100644
--- a/nixos/modules/virtualisation/containers.nix
+++ b/nixos/modules/virtualisation/containers.nix
@@ -34,6 +34,25 @@ in
         '';
       };
 
+    containersConf = mkOption {
+      default = {};
+      description = "containers.conf configuration";
+      type = types.submodule {
+        options = {
+
+          extraConfig = mkOption {
+            type = types.lines;
+            default = "";
+            description = ''
+              Extra configuration that should be put in the containers.conf
+              configuration file
+            '';
+
+          };
+        };
+      };
+    };
+
     registries = {
       search = mkOption {
         type = types.listOf types.str;
@@ -93,6 +112,12 @@ in
 
   config = lib.mkIf cfg.enable {
 
+    environment.etc."containers/containers.conf".text = ''
+      [network]
+      cni_plugin_dirs = ["${pkgs.cni-plugins}/bin/"]
+
+    '' + cfg.containersConf.extraConfig;
+
     environment.etc."containers/registries.conf".source = toTOML "registries.conf" {
       registries = lib.mapAttrs (n: v: { registries = v; }) cfg.registries;
     };
diff --git a/nixos/modules/virtualisation/podman.nix b/nixos/modules/virtualisation/podman.nix
index 652850bf500..e0e2f04e24c 100644
--- a/nixos/modules/virtualisation/podman.nix
+++ b/nixos/modules/virtualisation/podman.nix
@@ -28,6 +28,10 @@ let
 
 in
 {
+  imports = [
+    (lib.mkRenamedOptionModule [ "virtualisation" "podman" "libpod" ] [ "virtualisation" "containers" "containersConf" ])
+  ];
+
   meta = {
     maintainers = lib.teams.podman.members;
   };
@@ -67,25 +71,6 @@ in
       '';
     };
 
-    libpod = mkOption {
-      default = {};
-      description = "Libpod configuration";
-      type = types.submodule {
-        options = {
-
-          extraConfig = mkOption {
-            type = types.lines;
-            default = "";
-            description = ''
-              Extra configuration that should be put in the libpod.conf
-              configuration file
-            '';
-
-          };
-        };
-      };
-    };
-
     package = lib.mkOption {
       type = types.package;
       default = podmanPackage;
@@ -103,11 +88,6 @@ in
     environment.systemPackages = [ cfg.package ]
       ++ lib.optional cfg.dockerCompat dockerCompat;
 
-    environment.etc."containers/libpod.conf".text = ''
-      cni_plugin_dir = ["${pkgs.cni-plugins}/bin/"]
-
-    '' + cfg.libpod.extraConfig;
-
     environment.etc."cni/net.d/87-podman-bridge.conflist".source = copyFile "${pkgs.podman-unwrapped.src}/cni/87-podman-bridge.conflist";
 
     # Enable common /etc/containers configuration