nixos/podman: Create docker socket symlink via socket unit (#305803)

This ensures that both "sockets" are available after sockets.target.
See https://github.com/hercules-ci/arion/issues/238
This commit is contained in:
Robert Hensing 2024-05-02 16:04:37 +02:00 committed by GitHub
parent 480b871f2d
commit 188ba247d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,6 +219,11 @@ in
systemd.services.podman.environment = config.networking.proxy.envVars; systemd.services.podman.environment = config.networking.proxy.envVars;
systemd.sockets.podman.wantedBy = [ "sockets.target" ]; systemd.sockets.podman.wantedBy = [ "sockets.target" ];
systemd.sockets.podman.socketConfig.SocketGroup = "podman"; systemd.sockets.podman.socketConfig.SocketGroup = "podman";
# Podman does not support multiple sockets, as of podman 5.0.2, so we use
# a symlink. Unfortunately this does not let us use an alternate group,
# such as `docker`.
systemd.sockets.podman.socketConfig.Symlinks =
lib.mkIf cfg.dockerSocket.enable [ "/run/docker.sock" ];
systemd.user.services.podman.environment = config.networking.proxy.envVars; systemd.user.services.podman.environment = config.networking.proxy.envVars;
systemd.user.sockets.podman.wantedBy = [ "sockets.target" ]; systemd.user.sockets.podman.wantedBy = [ "sockets.target" ];
@ -239,11 +244,6 @@ in
'') '')
]; ];
systemd.tmpfiles.rules =
lib.optionals cfg.dockerSocket.enable [
"L! /run/docker.sock - - - - /run/podman/podman.sock"
];
users.groups.podman = { }; users.groups.podman = { };
assertions = [ assertions = [