2024-03-05 22:57:41 +01:00
|
|
|
{...}: {
|
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;
|
2023-10-12 10:19:16 +02:00
|
|
|
# Fix waiting for docker containers to exit on shutdown/reboot
|
|
|
|
# https://discourse.nixos.org/t/docker-hanging-on-reboot/18270/4
|
|
|
|
liveRestore = false;
|
2023-08-25 00:52:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# 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.
|
2024-03-05 22:57:41 +01:00
|
|
|
users.extraGroups.docker.members = ["caspervk"];
|
2023-08-25 00:52:14 +02:00
|
|
|
|
|
|
|
# Persist docker volumes
|
|
|
|
environment.persistence."/nix/persist" = {
|
|
|
|
directories = [
|
2024-03-05 22:57:41 +01:00
|
|
|
{
|
|
|
|
directory = "/var/lib/docker";
|
|
|
|
user = "root";
|
|
|
|
group = "root";
|
|
|
|
mode = "0700";
|
|
|
|
}
|
2023-08-25 00:52:14 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|