add docker

This commit is contained in:
Daniel Langbein 2023-09-14 15:54:48 +02:00
parent dbb1d8ed51
commit 9694489910
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
5 changed files with 35 additions and 3 deletions

View File

@ -43,6 +43,7 @@ in
#../../modules/digikam.nix
#../../modules/android.nix
#../../modules/podman.nix
#../../modules/docker.nix
];
networking.hostName = "yodaTab";

View File

@ -42,7 +42,8 @@ in
../../modules/thunderbird.nix
../../modules/digikam.nix
../../modules/android.nix
../../modules/podman.nix
#../../modules/podman.nix
../../modules/docker.nix
];
networking.hostName = "yodaTux";

View File

@ -44,7 +44,8 @@ in
#../../modules/thunderbird.nix
#../../modules/digikam.nix
#../../modules/android.nix
../../modules/podman.nix
#../../modules/podman.nix
../../modules/docker.nix
];
networking.hostName = "yodaYoga";

29
modules/docker.nix Normal file
View File

@ -0,0 +1,29 @@
{ 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"
];
};
};
}

View File

@ -5,7 +5,7 @@
# https://search.nixos.org/options?channel=23.05&query=virtualisation.podman
# TODO: Run as systemd services. https://nixos.wiki/wiki/Podman#Run_Podman_containers_as_systemd_services
# TODO: Podman Terminal UI: https://github.com/containers/podman-tui#podman-tui
# TODO: Podman Terminal UI. https://github.com/containers/podman-tui#podman-tui
environment.systemPackages = with pkgs; [
podman-compose