18 url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v${version}/UHK.Agent-${version}-linux-x86_64.AppImage";
19 name = "${pname}-${version}.AppImage";
20 sha256 = "sha256-5VzUSuq+yc8HXSILMg24w/hbwasf4jq0H0wte9Mw+nY=";
23 appimageContents = appimageTools.extract {
24 inherit pname version src;
27 stdenvNoCC.mkDerivation {
28 inherit pname version src;
39 (lib.getLib stdenv.cc.cc)
43 autoPatchelfIgnoreMissingDeps = [
44 "libc.musl-x86_64.so.1"
50 mkdir -p "$out"/{opt,share/applications}
52 cp -r --no-preserve=mode "${appimageContents}/resources" "$out/opt/${pname}"
53 cp -r --no-preserve=mode "${appimageContents}/usr/share/icons" "$out/share/icons"
54 cp -r --no-preserve=mode "${appimageContents}/${pname}.desktop" "$out/share/applications/${pname}.desktop"
56 substituteInPlace "$out/share/applications/${pname}.desktop" \
57 --replace "Exec=AppRun" "Exec=${pname}"
59 asar extract "$out/opt/${pname}/app.asar" "$out/opt/${pname}/app.asar.unpacked"
60 rm "$out/opt/${pname}/app.asar"
62 makeWrapper "${electron}/bin/electron" "$out/bin/${pname}" \
63 --add-flags "$out/opt/${pname}/app.asar.unpacked" \
64 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
65 --set-default ELECTRON_IS_DEV 0 \
72 description = "Agent is the configuration application of the Ultimate Hacking Keyboard";
73 homepage = "https://github.com/UltimateHackingKeyboard/agent";
74 license = licenses.unfreeRedistributable;
75 maintainers = with maintainers; [ ngiger nickcao ];
76 platforms = [ "x86_64-linux" ];