about summary refs log tree commit diff
path: root/nixos/modules/virtualisation/docker-rootless.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/virtualisation/docker-rootless.nix')
-rw-r--r--nixos/modules/virtualisation/docker-rootless.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/docker-rootless.nix b/nixos/modules/virtualisation/docker-rootless.nix
index 0e7f050314208..d371f67ecdc84 100644
--- a/nixos/modules/virtualisation/docker-rootless.nix
+++ b/nixos/modules/virtualisation/docker-rootless.nix
@@ -76,7 +76,11 @@ in
       # needs newuidmap from pkgs.shadow
       path = [ "/run/wrappers" ];
       environment = proxy_env;
-      unitConfig.StartLimitInterval = "60s";
+      unitConfig = {
+        # docker-rootless doesn't support running as root.
+        ConditionUser = "!root";
+        StartLimitInterval = "60s";
+      };
       serviceConfig = {
         Type = "notify";
         ExecStart = "${cfg.package}/bin/dockerd-rootless --config-file=${daemonSettingsFile}";