{ lib, config, ... }: let inherit (lib) mkIf; cfg = config.virt.docker; rootfs = config.fileSystems."/".fsType; in { config = mkIf cfg.enable { virtualisation.docker = { enable = true; enableOnBoot = false; storageDriver = if rootfs == "btrfs" then "btrfs" else null; }; users.groups.docker.members = [config.user]; }; }