25 , extraRuntimes ? lib.optionals stdenv.hostPlatform.isLinux [ runc ] # e.g.: runc, gvisor, youki
40 # do not add qemu to this wrapper, store paths get written to the podman vm config and break when GCed
42 binPath = lib.makeBinPath (lib.optionals stdenv.hostPlatform.isLinux [
47 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
51 helpersBin = symlinkJoin {
52 name = "podman-helper-binary-wrapper";
54 # this only works for some binaries, others may need to be added to `binPath` or in the modules
57 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
59 catatonit # added here for the pause image and also set in `containersConf` for `init_path`
71 src = fetchFromGitHub {
75 hash = "sha256-2FnUijeQhre7B4utsGGEGbMuuMVZlPDoM2di3z1d4vs=";
80 src = ./hardcode-paths.patch;
81 bin_path = helpersBin;
84 # we intentionally don't build and install the helper so we shouldn't display messages to users about it
85 ./rm-podman-mac-helper-msg.patch
92 outputs = [ "out" "man" ];
94 nativeBuildInputs = [ pkg-config go-md2man installShellFiles makeWrapper python3 ];
96 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
106 HELPER_BINARIES_DIR = "${PREFIX}/libexec/podman"; # used in buildPhase & installPhase
107 PREFIX = "${placeholder "out"}";
112 substituteInPlace Makefile --replace "/bin/bash" "${runtimeShell}"
113 ${if stdenv.hostPlatform.isDarwin then ''
114 make podman-remote # podman-mac-helper uses FHS paths
116 make bin/podman bin/rootlessport bin/quadlet
124 ${if stdenv.hostPlatform.isDarwin then ''
125 install bin/darwin/podman -Dt $out/bin
127 make install.bin install.systemd
129 make install.completions install.man
130 mkdir -p ${HELPER_BINARIES_DIR}
131 ln -s ${helpersBin}/bin/* ${HELPER_BINARIES_DIR}
132 wrapProgram $out/bin/podman \
133 --prefix PATH : ${lib.escapeShellArg binPath}
137 postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
138 RPATH=$(patchelf --print-rpath $out/bin/.podman-wrapped)
139 patchelf --set-rpath "${lib.makeLibraryPath [ systemd ]}":$RPATH $out/bin/.podman-wrapped
143 version = testers.testVersion {
145 command = "HOME=$TMPDIR podman --version";
147 } // lib.optionalAttrs stdenv.hostPlatform.isLinux {
148 inherit (nixosTests) podman;
151 podman-tls-ghostunnel
153 oci-containers-podman = nixosTests.oci-containers.podman;
157 homepage = "https://podman.io/";
158 description = "Program for managing pods, containers and container images";
160 Podman (the POD MANager) is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. Podman runs containers on Linux, but can also be used on Mac and Windows systems using a Podman-managed virtual machine. Podman is based on libpod, a library for container lifecycle management that is also contained in this repository. The libpod library provides APIs for managing containers, pods, container images, and volumes.
162 To install on NixOS, please use the option `virtualisation.podman.enable = true`.
164 changelog = "https://github.com/containers/podman/blob/v${version}/RELEASE_NOTES.md";
165 license = licenses.asl20;
166 maintainers = with maintainers; [ ] ++ teams.podman.members;
167 mainProgram = "podman";