18 rustPlatform.buildRustPackage rec {
22 src = fetchFromGitHub {
23 owner = "tranxuanthang";
26 hash = "sha256-OrmSaRKhGCl5sTirzICx8PBsQm23pYUBBtb07+P1ZbY=";
29 sourceRoot = "${src.name}/src-tauri";
31 cargoHash = "sha256-V9+/sfCxeZJ39nOuMBv2YlkzewoS+N3kFyBGdIqkw/A=";
33 frontend = buildNpmPackage {
36 # FIXME: This is a workaround, because we have a git dependency node_modules/lrc-kit contains install scripts
37 # but has no lockfile, which is something that will probably break.
41 # To fix `npm ERR! Your cache folder contains root-owned files`
42 makeCacheWritable = true;
44 npmDepsHash = "sha256-qQ5UMO3UuD6IvUveTRF35qTlGq5PMbxp1Q4UroDqVtk=";
51 # copy the frontend static resources to final build directory
52 # Also modify tauri.conf.json so that it expects the resources at the new location
54 cp -r $frontend ./frontend
56 substituteInPlace tauri.conf.json --replace-fail '"distDir": "../dist"' '"distDir": "./frontend"'
63 rustPlatform.bindgenHook
72 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
76 ++ lib.optionals stdenv.hostPlatform.isDarwin [
77 darwin.apple_sdk.frameworks.CoreAudio
78 darwin.apple_sdk.frameworks.WebKit
81 # Disable checkPhase, since the project doesn't contain tests
85 install -DT icons/128x128@2x.png $out/share/icons/hicolor/128x128@2/apps/lrcget.png
86 install -DT icons/128x128.png $out/share/icons/hicolor/128x128/apps/lrcget.png
87 install -DT icons/32x32.png $out/share/icons/hicolor/32x32/apps/lrcget.png
90 # WEBKIT_DISABLE_COMPOSITING_MODE essential in NVIDIA + compositor https://github.com/NixOS/nixpkgs/issues/212064#issuecomment-1400202079
92 wrapProgram "$out/bin/lrcget" \
93 --set WEBKIT_DISABLE_COMPOSITING_MODE 1
101 desktopName = "LRCGET";
102 comment = meta.description;
107 description = "Utility for mass-downloading LRC synced lyrics for your offline music library";
108 homepage = "https://github.com/tranxuanthang/lrcget";
109 changelog = "https://github.com/tranxuanthang/lrcget/releases/tag/${version}";
110 license = lib.licenses.mit;
111 maintainers = with lib.maintainers; [
115 mainProgram = "lrcget";
116 platforms = with lib.platforms; unix ++ windows;