summaryrefslogtreecommitdiff
path: root/system/virt/docker.nix
blob: 8f7c5ba9843610ea7405ef2beaf2c928ba32c991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  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];
  };
}