nixos/modules/base/docker.nix

23 lines
680 B
Nix
Raw Normal View History

2023-08-25 00:52:14 +02:00
{ ... }: {
# Docker is a utility to pack, ship and run any application as a lightweight
# container.
# https://nixos.wiki/wiki/Docker
virtualisation.docker = {
enable = true;
# Automatically `docker system prune` weekly
autoPrune.enable = true;
};
# Being a member of the docker group is effectively equivalent to being root,
# but without the annoyance of having to type your sudo password all the time.
users.extraGroups.docker.members = [ "caspervk" ];
# Persist docker volumes
environment.persistence."/nix/persist" = {
directories = [
2023-08-26 15:15:48 +02:00
{ directory = "/var/lib/docker"; user = "root"; group = "root"; mode = "0700"; }
2023-08-25 00:52:14 +02:00
];
};
}