1 { lib, stdenv, fetchFromGitLab, pkg-config, wrapGAppsHook3
2 , withLibui ? true, gtk3
3 , withUdisks ? stdenv.hostPlatform.isLinux, udisks, glib
6 stdenv.mkDerivation rec {
10 src = fetchFromGitLab {
14 hash = "sha256-HTFopc2xrhp0XYubQtOwMKWTQ+3JSKAyL4mMyQ82kAs=";
17 sourceRoot = "${src.name}/src";
19 nativeBuildInputs = [ pkg-config wrapGAppsHook3 ];
20 buildInputs = lib.optionals withUdisks [ udisks glib ]
21 ++ lib.optional (!withLibui) libX11
22 ++ lib.optional withLibui gtk3;
23 # libui is bundled with the source of usbimager as a compiled static library
27 -e 's|install -m 2755 -g disk|install |g' \
28 -e 's|-I/usr/include/gio-unix-2.0|-I${glib.dev}/include/gio-unix-2.0|g' \
29 -e 's|install -m 2755 -g $(GRP)|install |g' Makefile
33 substituteInPlace $out/share/applications/usbimager.desktop \
34 --replace-fail "Exec=/usr/bin/usbimager" "Exec=usbimager"
39 makeFlags = [ "PREFIX=$(out)" ]
40 ++ lib.optional withLibui "USE_LIBUI=yes"
41 ++ lib.optional withUdisks "USE_UDISKS2=yes";
44 description = "Very minimal GUI app that can write compressed disk images to USB drives";
45 homepage = "https://gitlab.com/bztsrc/usbimager";
46 license = licenses.mit;
47 maintainers = with maintainers; [ vdot0x23 ];
48 # windows and darwin could work, but untested
49 # feel free add them if you have a machine to test
50 platforms = with platforms; linux;
51 # never built on aarch64-linux since first introduction in nixpkgs
52 broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
53 mainProgram = "usbimager";