37 # do not add qemu to this wrapper, store paths get written to the podman vm config and break when GCed
39 binPath = lib.makeBinPath (lib.optionals stdenv.isLinux [
49 helpersBin = symlinkJoin {
50 name = "podman-helper-binary-wrapper";
52 # this only works for some binaries, others may need to be be added to `binPath` or in the modules
55 ] ++ lib.optionals stdenv.isLinux [
57 catatonit # added here for the pause image and also set in `containersConf` for `init_path`
67 src = fetchFromGitHub {
71 hash = "sha256-o5FTCuFUbTlENqvh+u6fPEfD816tKWPxHu2yhBi/Mf0=";
75 # we intentionally don't build and install the helper so we shouldn't display messages to users about it
76 ./rm-podman-mac-helper-msg.patch
83 outputs = [ "out" "man" ];
85 nativeBuildInputs = [ pkg-config go-md2man installShellFiles makeWrapper python3 ];
87 buildInputs = lib.optionals stdenv.isLinux [
97 HELPER_BINARIES_DIR = "${PREFIX}/libexec/podman"; # used in buildPhase & installPhase
98 PREFIX = "${placeholder "out"}";
103 substituteInPlace Makefile --replace "/bin/bash" "${runtimeShell}"
104 ${if stdenv.isDarwin then ''
105 make podman-remote # podman-mac-helper uses FHS paths
107 make bin/podman bin/rootlessport bin/quadlet
115 ${if stdenv.isDarwin then ''
116 install bin/darwin/podman -Dt $out/bin
118 make install.bin install.systemd
120 make install.completions install.man
121 mkdir -p ${HELPER_BINARIES_DIR}
122 ln -s ${helpersBin}/bin/* ${HELPER_BINARIES_DIR}
123 wrapProgram $out/bin/podman \
124 --prefix PATH : ${lib.escapeShellArg binPath}
128 postFixup = lib.optionalString stdenv.isLinux ''
129 RPATH=$(patchelf --print-rpath $out/bin/.podman-wrapped)
130 patchelf --set-rpath "${lib.makeLibraryPath [ systemd ]}":$RPATH $out/bin/.podman-wrapped
134 version = testers.testVersion {
136 command = "HOME=$TMPDIR podman --version";
138 } // lib.optionalAttrs stdenv.isLinux {
139 inherit (nixosTests) podman;
142 podman-tls-ghostunnel
144 oci-containers-podman = nixosTests.oci-containers.podman;
148 homepage = "https://podman.io/";
149 description = "A program for managing pods, containers and container images";
151 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.
153 To install on NixOS, please use the option `virtualisation.podman.enable = true`.
155 changelog = "https://github.com/containers/podman/blob/v${version}/RELEASE_NOTES.md";
156 license = licenses.asl20;
157 maintainers = with maintainers; [ marsam ] ++ teams.podman.members;