Files
nix/modules/nixos/virtualize/docker.nix
2025-05-07 15:20:28 +08:00

26 lines
719 B
Nix

{ config, pkgs, lib, username, ... }:
{
# Enable Docker
virtualisation.docker = {
enable = true;
storageDriver = "btrfs";
daemon.settings = {
userland-proxy = false;
experimental = true;
ipv6 = true;
ip6tables = true;
fixed-cidr-v6 = "fd00::/80";
metrics-addr = "0.0.0.0:9323";
log-driver = "json-file";
log-opts.max-size = "10m";
log-opts.max-file = "3";
};
};
# Enable Podman
# virtualisation.podman.enable = true;
#virtualisation.podman.dockerCompat = true; # Create a `docker` alias for podman, to use it as a drop-in replacement
users.users.${username}.extraGroups = lib.mkIf config.virtualisation.docker.enable [ "docker" ];
}