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 = { flake.modules.nixos.pc = args: {
virtualisation = { options.docker.enable = lib.mkEnableOption "Enable Docker";
oci-containers.backend = "docker";
docker = { config = lib.mkIf args.config.docker.enable {
enable = true; virtualisation = {
oci-containers.backend = "docker";
autoPrune = { docker = {
enable = true; 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" ];
};
}; };
} }