diff --git a/nixos/modules/virtualisation/podman.nix b/nixos/modules/virtualisation/podman.nix index 98da5a096d91..0223c0df1f22 100644 --- a/nixos/modules/virtualisation/podman.nix +++ b/nixos/modules/virtualisation/podman.nix @@ -105,6 +105,16 @@ in })); }; + systemd.packages = [ cfg.package ]; + + systemd.services.podman.serviceConfig = { + ExecStart = [ "" "${cfg.package}/bin/podman $LOGGING system service" ]; + }; + + systemd.sockets.podman.wantedBy = [ "sockets.target" ]; + + systemd.tmpfiles.packages = [ cfg.package ]; + assertions = [ { assertion = cfg.dockerCompat -> !config.virtualisation.docker.enable; diff --git a/pkgs/applications/virtualization/podman/default.nix b/pkgs/applications/virtualization/podman/default.nix index e3ff4fc417d2..0f212aedfa6b 100644 --- a/pkgs/applications/virtualization/podman/default.nix +++ b/pkgs/applications/virtualization/podman/default.nix @@ -63,6 +63,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 contrib/tmpfile/podman.conf -t $out/lib/tmpfiles.d + install -Dm644 contrib/systemd/system/podman.{socket,service} -t $out/lib/systemd/system ''; passthru.tests = { inherit (nixosTests) podman; }; diff --git a/pkgs/applications/virtualization/podman/wrapper.nix b/pkgs/applications/virtualization/podman/wrapper.nix index 976ba6c67b36..ae163583e699 100644 --- a/pkgs/applications/virtualization/podman/wrapper.nix +++ b/pkgs/applications/virtualization/podman/wrapper.nix @@ -48,6 +48,7 @@ in runCommand podman.name { ln -s ${podman.man} $man mkdir -p $out/bin + ln -s ${podman-unwrapped}/lib $out/lib ln -s ${podman-unwrapped}/share $out/share makeWrapper ${podman-unwrapped}/bin/podman $out/bin/podman \ --prefix PATH : ${binPath}