commit d7574293f6f3fda9c132e3e613351d51ac45f046
parent ab39d2cab281b1b01855a959bc480f7a9f1e1c07
Author: Vincent Demeester <vincent@sbr.pm>
Date: Wed, 9 Dec 2020 19:03:41 +0100
flake: removing useless profiles…
… and use the modules directly.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
7 files changed, 8 insertions(+), 99 deletions(-)
diff --git a/systems/modules/buildkit.nix b/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 ];
diff --git a/systems/modules/containerd.nix b/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";
};
diff --git a/systems/modules/profiles/buildkit.nix b/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";
- };
- };
- };
-}
diff --git a/systems/modules/profiles/containerd.nix b/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 ];
- };
- };
- };
-}
diff --git a/systems/modules/profiles/default.nix b/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
diff --git a/systems/modules/profiles/docker.nix b/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;
diff --git a/users/vincent/default.nix b/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;