Files
nixpkgs/pkgs/by-name/us/usbimager/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

74 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
pkg-config,
wrapGAppsHook3,
withLibui ? true,
gtk3,
withUdisks ? stdenv.hostPlatform.isLinux,
udisks,
glib,
libX11,
}:
stdenv.mkDerivation rec {
pname = "usbimager";
version = "1.0.10";
src = fetchFromGitLab {
owner = "bztsrc";
repo = "usbimager";
rev = version;
hash = "sha256-HTFopc2xrhp0XYubQtOwMKWTQ+3JSKAyL4mMyQ82kAs=";
};
sourceRoot = "${src.name}/src";
nativeBuildInputs = [
pkg-config
wrapGAppsHook3
];
buildInputs =
lib.optionals withUdisks [
udisks
glib
]
++ lib.optional (!withLibui) libX11
++ lib.optional withLibui gtk3;
# libui is bundled with the source of usbimager as a compiled static library
postPatch = ''
sed -i \
-e 's|install -m 2755 -g disk|install |g' \
-e 's|-I/usr/include/gio-unix-2.0|-I${glib.dev}/include/gio-unix-2.0|g' \
-e 's|install -m 2755 -g $(GRP)|install |g' Makefile
'';
postInstall = ''
substituteInPlace $out/share/applications/usbimager.desktop \
--replace-fail "Exec=/usr/bin/usbimager" "Exec=usbimager"
'';
dontConfigure = true;
makeFlags = [
"PREFIX=$(out)"
]
++ lib.optional withLibui "USE_LIBUI=yes"
++ lib.optional withUdisks "USE_UDISKS2=yes";
meta = with lib; {
description = "Very minimal GUI app that can write compressed disk images to USB drives";
homepage = "https://gitlab.com/bztsrc/usbimager";
license = licenses.mit;
maintainers = with maintainers; [ vdot0x23 ];
# windows and darwin could work, but untested
# feel free add them if you have a machine to test
platforms = with platforms; linux;
# never built on aarch64-linux since first introduction in nixpkgs
broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
mainProgram = "usbimager";
};
}