mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
30 lines
871 B
Nix
30 lines
871 B
Nix
|
{ config, pkgs, ... }:
|
||
|
|
||
|
{
|
||
|
# https://nixos.wiki/wiki/Docker#Installation
|
||
|
|
||
|
# TODO: rootless Docker. https://nixos.wiki/wiki/Docker#Rootless_docker
|
||
|
# TODO: run as systemd services. https://nixos.wiki/wiki/Docker#docker_containers_as_systemd_services
|
||
|
|
||
|
virtualisation = {
|
||
|
docker = {
|
||
|
enable = true;
|
||
|
|
||
|
# As we use btrfs, we enable the according storageDriver option.
|
||
|
storageDriver = "btrfs";
|
||
|
|
||
|
# Run `docker system prune -f` every week.
|
||
|
autoPrune.enable = true;
|
||
|
autoPrune.dates = "weekly";
|
||
|
# https://docs.docker.com/engine/reference/commandline/system_prune/#options
|
||
|
autoPrune.flags = [
|
||
|
"--all"
|
||
|
"--volumes"
|
||
|
# https://docs.docker.com/engine/reference/commandline/system_prune/#filter
|
||
|
# https://pkg.go.dev/maze.io/x/duration#ParseDuration
|
||
|
"--filter until=7d"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|