From f4902536aa58ef95857a2c55fb650105bb87b442 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Fri, 16 Jul 2021 13:08:20 +1000 Subject: [PATCH] podman: add darwin wrapper with qemu for podman machine - requires xz to unpack vm image - remove linux install conditional to simplify wrapper --- pkgs/applications/virtualization/podman/default.nix | 2 -- pkgs/applications/virtualization/podman/wrapper.nix | 8 +++++++- pkgs/top-level/all-packages.nix | 5 +---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/virtualization/podman/default.nix b/pkgs/applications/virtualization/podman/default.nix index 5ab696ed1d57..227439713ed3 100644 --- a/pkgs/applications/virtualization/podman/default.nix +++ b/pkgs/applications/virtualization/podman/default.nix @@ -64,11 +64,9 @@ buildGoModule rec { installShellCompletion --fish completions/fish/* installShellCompletion --zsh completions/zsh/* MANDIR=$man/share/man make install.man-nobuild - '' + lib.optionalString stdenv.isLinux '' install -Dm644 cni/87-podman-bridge.conflist -t $out/etc/cni/net.d install -Dm644 contrib/tmpfile/podman.conf -t $out/lib/tmpfiles.d install -Dm644 contrib/systemd/system/podman.{socket,service} -t $out/lib/systemd/system - '' + '' runHook postInstall ''; diff --git a/pkgs/applications/virtualization/podman/wrapper.nix b/pkgs/applications/virtualization/podman/wrapper.nix index c9ec18593dff..820e8ad18bcc 100644 --- a/pkgs/applications/virtualization/podman/wrapper.nix +++ b/pkgs/applications/virtualization/podman/wrapper.nix @@ -2,6 +2,7 @@ , runCommand , makeWrapper , lib +, stdenv , extraPackages ? [] , podman # Docker compat , runc # Default container runtime @@ -13,12 +14,14 @@ , cni-plugins # not added to path , iptables , iproute2 +, qemu +, xz }: let podman = podman-unwrapped; - binPath = lib.makeBinPath ([ + binPath = lib.makeBinPath ([ ] ++ lib.optionals stdenv.isLinux [ runc crun conmon @@ -27,6 +30,9 @@ let util-linux iptables iproute2 + ] ++ lib.optionals stdenv.isDarwin [ + qemu + xz ] ++ extraPackages); in runCommand podman.name { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 999eac9d3862..cf4670295d24 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8056,10 +8056,7 @@ in podiff = callPackage ../tools/text/podiff { }; - podman = if stdenv.isDarwin then - callPackage ../applications/virtualization/podman { } - else - callPackage ../applications/virtualization/podman/wrapper.nix { }; + podman = callPackage ../applications/virtualization/podman/wrapper.nix { }; podman-unwrapped = callPackage ../applications/virtualization/podman { }; podman-compose = python3Packages.callPackage ../applications/virtualization/podman-compose {};