41 # do not add qemu to this wrapper, store paths get written to the podman vm config and break when GCed
43 binPath = lib.makeBinPath (lib.optionals stdenv.isLinux [
50 helpersBin = symlinkJoin {
51 name = "podman-helper-binary-wrapper";
53 # this only works for some binaries, others may need to be be added to `binPath` or in the modules
56 ] ++ lib.optionals stdenv.isLinux [
58 catatonit # added here for the pause image and also set in `containersConf` for `init_path`
69 src = fetchFromGitHub {
73 hash = "sha256-8Swqwyzu/WI9mG21bLF81Kk4kS2Ltg0GV9G3EcG/FnU=";
77 # we intentionally don't build and install the helper so we shouldn't display messages to users about it
78 ./rm-podman-mac-helper-msg.patch
79 ] ++ lib.optionals stdenv.isLinux [
81 src = ./hardcode-paths.patch;
82 inherit crun runc gvisor youki conmon;
90 outputs = [ "out" "man" ];
92 nativeBuildInputs = [ pkg-config go-md2man installShellFiles makeWrapper python3 ];
94 buildInputs = lib.optionals stdenv.isLinux [
104 HELPER_BINARIES_DIR = "${PREFIX}/libexec/podman"; # used in buildPhase & installPhase
105 PREFIX = "${placeholder "out"}";
110 substituteInPlace Makefile --replace "/bin/bash" "${runtimeShell}"
111 ${if stdenv.isDarwin then ''
112 make podman-remote # podman-mac-helper uses FHS paths
114 make bin/podman bin/rootlessport bin/quadlet
122 ${if stdenv.isDarwin then ''
123 install bin/darwin/podman -Dt $out/bin
125 make install.bin install.systemd
127 make install.completions install.man
128 mkdir -p ${HELPER_BINARIES_DIR}
129 ln -s ${helpersBin}/bin/* ${HELPER_BINARIES_DIR}
130 wrapProgram $out/bin/podman \
131 --prefix PATH : ${lib.escapeShellArg binPath}
135 postFixup = lib.optionalString stdenv.isLinux ''
136 RPATH=$(patchelf --print-rpath $out/bin/.podman-wrapped)
137 patchelf --set-rpath "${lib.makeLibraryPath [ systemd ]}":$RPATH $out/bin/.podman-wrapped
141 version = testers.testVersion {
143 command = "HOME=$TMPDIR podman --version";
145 } // lib.optionalAttrs stdenv.isLinux {
146 inherit (nixosTests) podman;
149 podman-tls-ghostunnel
151 oci-containers-podman = nixosTests.oci-containers.podman;
155 homepage = "https://podman.io/";
156 description = "A program for managing pods, containers and container images";
158 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.
160 To install on NixOS, please use the option `virtualisation.podman.enable = true`.
162 changelog = "https://github.com/containers/podman/blob/v${version}/RELEASE_NOTES.md";
163 license = licenses.asl20;
164 maintainers = with maintainers; [ marsam ] ++ teams.podman.members;
165 mainProgram = "podman";