From 57bf0bf7533ac27141e57107c1e4ced3c9af72d1 Mon Sep 17 00:00:00 2001 From: aleksana Date: Tue, 12 Mar 2024 13:08:20 +0800 Subject: [PATCH] boxbuddy: init at 2.1.3 --- pkgs/by-name/bo/boxbuddy/package.nix | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pkgs/by-name/bo/boxbuddy/package.nix diff --git a/pkgs/by-name/bo/boxbuddy/package.nix b/pkgs/by-name/bo/boxbuddy/package.nix new file mode 100644 index 000000000000..6a07d82d83cb --- /dev/null +++ b/pkgs/by-name/bo/boxbuddy/package.nix @@ -0,0 +1,61 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, wrapGAppsHook4 +, libadwaita +, distrobox +}: + +rustPlatform.buildRustPackage rec { + pname = "boxbuddy"; + version = "2.1.3"; + + src = fetchFromGitHub { + owner = "Dvlv"; + repo = "BoxBuddyRS"; + rev = version; + hash = "sha256-Jl9WhMqb40Olub5eV7Meu5DJi+bzWhPf3DCRPe4CMfo="; + }; + + cargoHash = "sha256-HN+yGODTRXRa3AsBOuRVOnnU2pxBZfy0zlnCWs2oQCI="; + + # The software assumes it is installed either in flatpak or in the home directory + # so the xdg data path needs to be patched here + postPatch = '' + substituteInPlace src/utils.rs \ + --replace-fail '{data_home}/locale' "$out/share/locale" \ + --replace-fail '{data_home}/icons/boxbuddy/{}' "$out/share/icons/boxbuddy/{}" + ''; + + nativeBuildInputs = [ + pkg-config + wrapGAppsHook4 + ]; + + buildInputs = [ + libadwaita + ]; + + postInstall = '' + cp icons/* ./ + XDG_DATA_HOME=$out/share INSTALL_DIR=$out ./scripts/install.sh + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH : ${lib.makeBinPath [ distrobox ]} + ) + ''; + + doCheck = false; # No checks defined + + meta = with lib; { + description = "An unofficial GUI for managing your Distroboxes, written with GTK4 + Libadwaita"; + homepage = "https://dvlv.github.io/BoxBuddyRS"; + license = licenses.mit; + mainProgram = "boxbuddy-rs"; + maintainers = with maintainers; [ aleksana ]; + platforms = platforms.linux; + }; +}