all repos — nixfiles @ d41b386aaf7172fb2d220399e5975269ab79a8cb

System and user configuration, managed by nix and home-manager

Enable rootless docker
Alan Pearce alan@alanpearce.eu
Thu, 04 Apr 2024 17:57:58 +0200
commit

d41b386aaf7172fb2d220399e5975269ab79a8cb

parent

c0e1054c66c49423e69de686955c3671b39d1888

2 files changed, 24 insertions(+), 0 deletions(-)

jump to
M system/prefect.nixsystem/prefect.nix
@@ -27,6 +27,7 @@ ./settings/programs/base.nix     ./settings/programs/gnupg.nix
     ./settings/programs/kde.nix
     ./settings/programs/shell.nix
+    ./settings/programs/docker.nix
     ./settings/gaming.nix
   ];
 
A system/settings/programs/docker.nix
@@ -0,0 +1,23 @@+{ ... }: {
+  virtualisation.docker = {
+    enable = false;
+    storageDriver = "overlay2";
+    rootless = {
+      enable = true;
+      setSocketVariable = true;
+      daemon.settings = {
+        fixed-cidr-v6 = "fd0c::/80";
+        ipv6 = true;
+        dns = [
+          "1.0.0.1"
+          "1.1.1.1"
+        ];
+      };
+    };
+  };
+  # TODO: autoPrune doesn't affect rootless
+  # systemd.timers.docker-prune.timerConfig = {
+  #   Persistent = true;
+  #   RandomizedDelaySec = 1800;
+  # };
+}