Make Docker toggleable

This commit is contained in:
Oliver Davies 2025-07-25 02:13:01 +01:00
parent 6728f32ffc
commit 37673680cd

View file

@ -1,20 +1,24 @@
{ config, ... }:
{ config, lib, ... }:
{
flake.modules.nixos.pc = {
virtualisation = {
oci-containers.backend = "docker";
flake.modules.nixos.pc = args: {
options.docker.enable = lib.mkEnableOption "Enable Docker";
docker = {
enable = true;
config = lib.mkIf args.config.docker.enable {
virtualisation = {
oci-containers.backend = "docker";
autoPrune = {
docker = {
enable = true;
dates = "weekly";
autoPrune = {
enable = true;
dates = "weekly";
};
};
};
};
users.users.${config.flake.meta.owner.username}.extraGroups = [ "docker" ];
users.users.${config.flake.meta.owner.username}.extraGroups = [ "docker" ];
};
};
}