nix-config/modules/docker.nix

25 lines
500 B
Nix
Raw Permalink Normal View History

2025-07-25 02:13:01 +01:00
{ config, lib, ... }:
{
2025-07-25 02:13:01 +01:00
flake.modules.nixos.pc = args: {
options.docker.enable = lib.mkEnableOption "Enable Docker";
2025-07-25 02:13:01 +01:00
config = lib.mkIf args.config.docker.enable {
virtualisation = {
oci-containers.backend = "docker";
2025-07-25 02:13:01 +01:00
docker = {
enable = true;
2025-07-25 02:13:01 +01:00
autoPrune = {
enable = true;
dates = "weekly";
};
};
};
2025-07-24 23:53:29 +01:00
2025-07-25 02:13:01 +01:00
users.users.${config.flake.meta.owner.username}.extraGroups = [ "docker" ];
};
};
}