···
effectiveUser = container.podman.user or "root";
+
inherit (config.users.users.${effectiveUser}) uid;
cfg.backend == "podman" && effectiveUser != "root" && config.users.users.${effectiveUser}.linger;
···
wantedBy = [ ] ++ optional (container.autoStart) "multi-user.target";
lib.optional (container.imageFile == null && container.imageStream == null) "network-online.target"
+
++ lib.optionals dependOnLingerService [ "linger-users.service" ];
lib.optionals (cfg.backend == "docker") [
···
+
++ lib.optionals dependOnLingerService [ "linger-users.service" ]
+
++ lib.optionals (effectiveUser != "root" && container.podman.sdnotify == "healthy") [
+
"user@${toString uid}.service"
+
++ lib.optionals (effectiveUser != "root" && container.podman.sdnotify == "healthy") [
+
"user@${toString uid}.service"
environment = lib.mkMerge [
(mkIf (cfg.backend == "podman" && container.podman.user != "root") {
···
"${cfg.backend} rm -f ${name} || true";
+
unitConfig = mkIf (effectiveUser != "root") {
+
RequiresMountsFor = "/run/user/${toString uid}/containers";
### There is no generalized way of supporting `reload` for docker
···
assertion = cfg.backend == "docker" -> podman == null;
message = "virtualisation.oci-containers.containers.${name}: Cannot set `podman` option if backend is `docker`.";
+
cfg.backend == "podman" && podman.sdnotify == "healthy" && podman.user != "root"
+
-> config.users.users.${podman.user}.uid != null;
+
Rootless container ${name} (with podman and sdnotify=healthy)
+
requires that its running user ${podman.user} has a statically specified uid.