depot/third_party/nixpkgs/pkgs/applications/virtualization/distrobox/default.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

54 lines
1.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ stdenvNoCC, lib, fetchFromGitHub, makeWrapper, wget }:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "distrobox";
version = "1.6.0.1";
src = fetchFromGitHub {
owner = "89luca89";
repo = "distrobox";
rev = finalAttrs.version;
hash = "sha256-UWrXpb20IHcwadPpwbhSjvOP1MBXic5ay+nP+OEVQE4=";
};
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
# https://github.com/89luca89/distrobox/pull/1080
patches = [ ./always-mount-nix.patch ];
installPhase = ''
runHook preInstall
# https://github.com/89luca89/distrobox/issues/408
substituteInPlace ./distrobox-generate-entry \
--replace 'icon_default="''${HOME}/.local' "icon_default=\"$out"
./install -P $out
runHook postInstall
'';
# https://github.com/89luca89/distrobox/issues/407
postFixup = ''
wrapProgram "$out/bin/distrobox-generate-entry" \
--prefix PATH ":" ${lib.makeBinPath [ wget ]}
mkdir -p $out/share/distrobox
echo 'container_additional_volumes="/nix:/nix"' > $out/share/distrobox/distrobox.conf
'';
meta = with lib; {
description = "Wrapper around podman or docker to create and start containers";
longDescription = ''
Use any linux distribution inside your terminal. Enable both backward and
forward compatibility with software and freedom to use whatever distribution
youre more comfortable with
'';
homepage = "https://distrobox.it/";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ atila ];
};
})