1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-04-13 15:57:47 +00:00
home-manager/tests/modules/services/podman-linux/container-expected.service
Tarow 27a72d9913
podman: include systemd in quadlet service path
Podman uses systemd-run to setup transient systemd timers, e.g. for healthchecks.

On systems where systemd is not present in /run/current-system/sw/bin or ~/.nix-profile/bin (like one of my Ubuntu hosts), setting up the transient timers will fail. For containers with healthchecks configured, this results in the container being stuck in starting state.

Relevant issue here: containers/podman#25034
2025-03-19 14:09:57 -05:00

50 lines
2 KiB
Desktop File

# Automatically generated by /nix/store/00000000000000000000000000000000-podman/lib/systemd/user-generators/podman-user-generator
#
# Automatically generated by home-manager podman container configuration
# DO NOT EDIT THIS FILE DIRECTLY
#
# my-container.container
[X-Container]
AddDevice=/dev/null:/dev/null
AutoUpdate=registry
ContainerName=my-container
Entrypoint=/sleep.sh
Environment=VAL_A=A
Environment=VAL_B=2
Environment=VAL_C=false
Image=docker.io/alpine:latest
Label=nix.home-manager.managed=true
Network=mynet
NetworkAlias=test-alias-1
NetworkAlias=test-alias-2
PodmanArgs=--security-opt=no-new-privileges
PublishPort=8080:80
ReadOnlyTmpfs=true
Volume=/tmp:/tmp
[Install]
WantedBy=default.target
WantedBy=multi-user.target
[Service]
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Restart=on-failure
TimeoutStopSec=30
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
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 --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=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Before=fake.target
Description=home-manager test
SourcePath=/nix/store/00000000000000000000000000000000-home-container-podman-my-container/quadlets/podman-my-container.container
RequiresMountsFor=%t/containers
RequiresMountsFor=/tmp