nixos-config/system/app/docker.nix
2024-04-06 08:32:34 -05:00

27 lines
506 B
Nix

{ pkgs, lib, userSettings, storageDriver ? null, ... }:
assert lib.asserts.assertOneOf "storageDriver" storageDriver [
null
"aufs"
"btrfs"
"devicemapper"
"overlay"
"overlay2"
"zfs"
];
{
virtualisation.docker = {
enable = true;
enableOnBoot = true;
storageDriver = storageDriver;
autoPrune.enable = true;
};
users.users.${userSettings.username}.extraGroups = [ "docker" ];
environment.systemPackages = with pkgs; [
docker
docker-compose
lazydocker
];
}