Commit 9f188f04af96

Vincent Demeester <vincent@sbr.pm>
2018-12-01 13:57:52
profiles: update buildkit and containerd with package customization
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 4148a57
Changed files (2)
modules/profiles/buildkit.nix
@@ -12,18 +12,31 @@ in
         description = "Enable buildkit profile";
         type = types.bool;
       };
+      package = mkOption {
+        default = pkgs.nur.repos.vdemeester.buildkit;
+        description = "buildkit package to be used";
+        type = types.package;
+      };
+      runcPackage = mkOption {
+        default = pkgs.runc-edge;
+        description = "runc package to be used";
+        type = types.package;
+      };
     };
   };
   config = mkIf cfg.enable {
-    profiles.containerd.enable = true;
+    profiles.containerd = {
+      enable = true;
+      runcPackage = cfg.runcPackage;
+    };
     environment.systemPackages = with pkgs; [
-      buildkit
+      cfg.package
     ];
     virtualisation = {
       buildkitd= {
         enable = true;
-        package = pkgs.buildkit;
-        packages = [ pkgs.runc-edge pkgs.git ];
+        package = cfg.package;
+        packages = [ cfg.runcPackage pkgs.git ];
         extraOptions = "--oci-worker=false --containerd-worker=true";
       };
     };
modules/profiles/containerd.nix
@@ -12,21 +12,31 @@ in
         description = "Enable containerd profile";
         type = types.bool;
       };
+      package = mkOption {
+      default = pkgs.containerd-edge;
+        description = "containerd package to be used";
+        type = types.package;
+      };
+      runcPackage = mkOption {
+        default = pkgs.runc-edge;
+        description = "runc package to be used";
+        type = types.package;
+      };
     };
   };
   config = mkIf cfg.enable {
     environment.systemPackages = with pkgs; [
       cni
       cni-plugins
-      containerd-edge
-      runc-edge
+      cfg.package
+      cfg.runcPackage
       stellar
     ];
     virtualisation = {
       containerd = {
         enable = true;
-        package = pkgs.containerd-edge;
-        packages = [ pkgs.runc-edge ];
+        package = cfg.package;
+        packages = [ cfg.runcPackage ];
       };
     };
   };