From 221750d875727f182c78d08243d876dd2e055d0a Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Mon, 29 Apr 2024 22:50:28 +0200 Subject: [PATCH] podman --- modules/base/default.nix | 1 + modules/base/podman.nix | 30 ++++++++++++++++++++++++++++++ modules/borg.nix | 4 +++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 modules/base/podman.nix diff --git a/modules/base/default.nix b/modules/base/default.nix index 35c6ea8..475f0d8 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -11,6 +11,7 @@ ./network.nix ./nix.nix ./packages.nix + ./podman.nix ./ripgrep.nix ./ssh.nix ./sudo.nix diff --git a/modules/base/podman.nix b/modules/base/podman.nix new file mode 100644 index 0000000..1193ae8 --- /dev/null +++ b/modules/base/podman.nix @@ -0,0 +1,30 @@ +{...}: { + # Podman can run rootless containers and be a drop-in replacement for Docker. + # It is used for systemd services containers defined using + # `virtualisation.oci-containers`. + # https://wiki.nixos.org/wiki/Podman + virtualisation.containers.enable = true; + virtualisation.podman = { + enable = true; + # Automatically `podman system prune` weekly + autoPrune.enable = true; + # Required for containers under podman-compose to be able to talk to each + # other. + defaultNetwork.settings = { + dns_enabled = true; + ipv6_enabled = true; + }; + }; + + # Persist docker volumes + environment.persistence."/nix/persist" = { + directories = [ + { + directory = "/var/lib/containers"; + user = "root"; + group = "root"; + mode = "0700"; + } + ]; + }; +} diff --git a/modules/borg.nix b/modules/borg.nix index cb6815e..c999192 100644 --- a/modules/borg.nix +++ b/modules/borg.nix @@ -90,15 +90,17 @@ "! /**/found.000/*" "! /**/.cache" - "! /**/Cache" "! /**/cache" + "! /**/Cache" "! /srv/torrents" + "! /var/lib/containers/overlay*" "! /var/lib/docker/overlay2" "- *.tmp" "! /home/*/Android/Sdk" "! /home/*/Downloads" "! /home/*/GOG Games" + "! /home/*/.local/share/containers/storage/overlay*" "! /home/*/.steam" ];