Commit d7574293f6f3

Vincent Demeester <vincent@sbr.pm>
2020-12-09 19:03:41
flake: removing useless profiles…
… and use the modules directly. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent ab39d2c
systems/modules/profiles/buildkit.nix
@@ -1,40 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-let
-  cfg = config.profiles.buildkit;
-in
-{
-  options = {
-    profiles.buildkit = {
-      enable = mkEnableOption "Enable buildkit profile";
-      package = mkOption {
-        default = pkgs.my.buildkit;
-        description = "buildkit package to be used";
-        type = types.package;
-      };
-      runcPackage = mkOption {
-        default = pkgs.runc;
-        description = "runc package to be used";
-        type = types.package;
-      };
-    };
-  };
-  config = mkIf cfg.enable {
-    profiles.containerd = {
-      enable = true;
-      runcPackage = cfg.runcPackage;
-    };
-    environment.systemPackages = with pkgs; [
-      cfg.package
-    ];
-    virtualisation = {
-      buildkitd = {
-        enable = true;
-        package = cfg.package;
-        packages = [ cfg.runcPackage pkgs.git ];
-        extraOptions = "--oci-worker=false --containerd-worker=true";
-      };
-    };
-  };
-}
systems/modules/profiles/containerd.nix
@@ -1,48 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-let
-  cfg = config.profiles.containerd;
-in
-{
-  options = {
-    profiles.containerd = {
-      enable = mkEnableOption "Enable containerd profile";
-      package = mkOption {
-        default = pkgs.my.containerd;
-        description = "containerd package to be used";
-        type = types.package;
-      };
-      runcPackage = mkOption {
-        default = pkgs.runc;
-        description = "runc package to be used";
-        type = types.package;
-      };
-      cniPackage = mkOption {
-        default = pkgs.cni;
-        description = "cni package to be used";
-        type = types.package;
-      };
-      cniPluginsPackage = mkOption {
-        default = pkgs.cni-plugins;
-        description = "cni-plugins package to be used";
-        type = types.package;
-      };
-    };
-  };
-  config = mkIf cfg.enable {
-    environment.systemPackages = with pkgs; [
-      cfg.cniPackage
-      cfg.cniPluginsPackage
-      cfg.package
-      cfg.runcPackage
-    ];
-    virtualisation = {
-      containerd = {
-        enable = true;
-        package = cfg.package;
-        extraPackages = [ cfg.runcPackage ];
-      };
-    };
-  };
-}
systems/modules/profiles/default.nix
@@ -3,8 +3,6 @@
     # Remove "nixos" from here
     ./avahi.nix
     ./base.nix
-    ./buildkit.nix
-    ./containerd.nix
     ./desktop.nix
     ./dev.nix
     ./docker.nix
systems/modules/profiles/docker.nix
@@ -21,8 +21,12 @@ in
     };
   };
   config = mkIf cfg.enable {
-    profiles.containerd.enable = true;
     virtualisation = {
+      containerd.enable = true;
+      buildkitd = {
+        enable = true;
+        extraOptions = "--oci-worker=false --containerd-worker=true";
+      };
       docker = {
         enable = true;
         package = cfg.package;
systems/modules/buildkit.nix
@@ -41,12 +41,7 @@ in
   };
 
   config = mkIf cfg.enable {
-    users.groups = [
-      {
-        name = "buildkit";
-        gid = 350;
-      }
-    ];
+    users.groups.buildkit.gid = 350;
     environment.systemPackages = [ cfg.package ];
     systemd.packages = [ cfg.package ];
 
systems/modules/containerd.nix
@@ -25,7 +25,7 @@ in
 
     extraPackages = mkOption {
       type = types.listOf types.package;
-      default = [ pkgs.runc ];
+      default = [ pkgs.runc pkgs.cni pkgs.cni-plugins ];
       description = "List of packages to be added to containerd service path";
     };
 
users/vincent/default.nix
@@ -24,7 +24,7 @@ in
       ++ optionals config.profiles.scanning.enable [ "lp" "scanner" ]
       ++ optionals config.networking.networkmanager.enable [ "networkmanager" ]
       ++ optionals config.profiles.docker.enable [ "docker" ]
-      ++ optionals config.profiles.buildkit.enable [ "buildkit" ]
+      ++ optionals config.virtualisation.buildkitd.enable [ "buildkit" ]
       ++ optionals config.profiles.virtualization.enable [ "libvirtd" ];
     shell = mkIf config.programs.zsh.enable pkgs.zsh;
     isNormalUser = true;