diff --git a/modules/services/podman-linux/services.nix b/modules/services/podman-linux/services.nix index e7191e4cd..87ff83ad8 100644 --- a/modules/services/podman-linux/services.nix +++ b/modules/services/podman-linux/services.nix @@ -61,5 +61,12 @@ in { Install = { WantedBy = [ "timers.target" ]; }; }; }) + ({ + xdg.configFile."systemd/user/podman-user-wait-network-online.service.d/50-exec-search-path.conf".text = + '' + [Service] + ExecSearchPath=${pkgs.bashInteractive}/bin:${pkgs.systemd}/bin:/bin + ''; + }) ]); } diff --git a/tests/modules/services/podman-linux/container-expected.service b/tests/modules/services/podman-linux/container-expected.service index c9cfe6551..d40e24bec 100644 --- a/tests/modules/services/podman-linux/container-expected.service +++ b/tests/modules/services/podman-linux/container-expected.service @@ -38,11 +38,11 @@ Delegate=yes Type=notify NotifyAccess=all SyslogIdentifier=%N -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name=my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network=mynet --network-alias test-alias-1 --network-alias test-alias-2 --sdnotify=conmon -d --device=/dev/null:/dev/null --entrypoint=/sleep.sh --read-only-tmpfs -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --entrypoint /sleep.sh --network-alias test-alias-1 --network-alias test-alias-2 --read-only-tmpfs --network mynet --sdnotify=conmon -d --device /dev/null:/dev/null -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest [Unit] -Wants=network-online.target -After=network-online.target +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target Before=fake.target Description=home-manager test diff --git a/tests/modules/services/podman-linux/integration-container-expected.service b/tests/modules/services/podman-linux/integration-container-expected.service index 32f8e5195..528d9c18e 100644 --- a/tests/modules/services/podman-linux/integration-container-expected.service +++ b/tests/modules/services/podman-linux/integration-container-expected.service @@ -28,11 +28,11 @@ Delegate=yes Type=notify NotifyAccess=all SyslogIdentifier=%N -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name=my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network=my-net --network=externalnet --sdnotify=conmon -d --label nix.home-manager.managed=true docker.io/alpine:latest +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network my-net --network externalnet --sdnotify=conmon -d --label nix.home-manager.managed=true docker.io/alpine:latest [Unit] -Wants=network-online.target -After=network-online.target +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target After=podman-my-net-network.service Description=Service for container my-container diff --git a/tests/modules/services/podman-linux/integration-network-expected.service b/tests/modules/services/podman-linux/integration-network-expected.service index 3fd14857d..49acd4b9f 100644 --- a/tests/modules/services/podman-linux/integration-network-expected.service +++ b/tests/modules/services/podman-linux/integration-network-expected.service @@ -19,11 +19,14 @@ Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/0000 ExecStartPre=/nix/store/00000000000000000000000000000000-await-podman-unshare RemainAfterExit=yes TimeoutStartSec=15 -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet=192.168.123.0/24 --gateway=192.168.123.1 --label nix.home-manager.managed=true my-net -Type=oneshot +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet 192.168.123.0/24 --gateway 192.168.123.1 --label nix.home-manager.managed=true my-net SyslogIdentifier=%N +Type=oneshot [Unit] +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target Description=Service for network my-net +SourcePath=/nix/store/00000000000000000000000000000000-home-network-podman-my-net/quadlets/podman-my-net.network RequiresMountsFor=%t/containers diff --git a/tests/modules/services/podman-linux/network-expected.service b/tests/modules/services/podman-linux/network-expected.service index e2287a1f4..1017a17e7 100644 --- a/tests/modules/services/podman-linux/network-expected.service +++ b/tests/modules/services/podman-linux/network-expected.service @@ -23,11 +23,14 @@ Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/0000 ExecStartPre=/nix/store/00000000000000000000000000000000-await-podman-unshare RemainAfterExit=yes TimeoutStartSec=15 -ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet=192.168.1.0/24 --gateway=192.168.1.1 --opt isolate=true --label nix.home-manager.managed=true --ipam-driver dhcp --dns=192.168.55.1 --log-level=debug my-net -Type=oneshot +ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman network create --ignore --subnet 192.168.1.0/24 --gateway 192.168.1.1 --opt isolate=true --label nix.home-manager.managed=true --ipam-driver dhcp --dns=192.168.55.1 --log-level=debug my-net SyslogIdentifier=%N +Type=oneshot [Unit] +Wants=podman-user-wait-network-online.service +After=podman-user-wait-network-online.service After=network.target Description=Service for network my-net +SourcePath=/nix/store/00000000000000000000000000000000-home-network-podman-my-net/quadlets/podman-my-net.network RequiresMountsFor=%t/containers