added docker

This commit is contained in:
Jakub Kropáček 2024-09-26 21:05:27 +02:00
parent 838dbe9866
commit e41ded4213
4 changed files with 39 additions and 0 deletions

View file

@ -29,6 +29,9 @@
install-k8s-tools = true; install-k8s-tools = true;
install-cloud-cli = true; install-cloud-cli = true;
}; };
docker = {
enable = true;
};
}; };
systemd.services.configure-mic-leds = rec { systemd.services.configure-mic-leds = rec {

View file

@ -41,6 +41,7 @@ in
openssl_3_3 openssl_3_3
dig dig
wl-clipboard wl-clipboard
bitwarden-cli
] ]
++ lib.optionals cfg.install-editors [ ++ lib.optionals cfg.install-editors [
pkgs.lazygit pkgs.lazygit

View file

@ -9,5 +9,6 @@
./python.nix ./python.nix
./ide.nix ./ide.nix
./cli.nix ./cli.nix
./docker.nix
]; ];
} }

View file

@ -0,0 +1,34 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.krop.docker;
in
{
options.krop.docker = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether to enable Docker service.";
};
addUserToGroup = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = "Whether to add the user to the Docker group.";
};
};
config = lib.mkIf cfg.enable {
virtualisation.docker = {
enable = true;
};
users.users.krop = lib.mkIf cfg.addUserToGroup {
extraGroups = ["docker"];
};
};
}