19 pname = "squirreldisk";
22 src = fetchFromGitHub {
24 repo = "squirreldisk";
26 hash = "sha256-As2nvc68knjeLPuX0QLBoybj8vuvkpS5Vr+7U7E5CjA=";
28 frontend-build = buildNpmPackage {
30 pname = "squirreldisk-ui";
32 npmDepsHash = "sha256-Japcn0KYP7aYIDK8+Ns+mrnbbAb0fLWXHIV2+yltI6I=";
34 packageJSON = ./package.json;
42 rustPlatform.buildRustPackage rec {
43 inherit version src pname;
45 sourceRoot = "${src.name}/src-tauri";
48 lockFile = ./Cargo.lock;
50 "window-shadows-0.2.1" = "sha256-3meM04TG63PvB0M5wUH1cDMBo7ObcB0zdgwGt2aKHMs=";
54 # copy the frontend static resources to final build directory
55 # Also modify tauri.conf.json so that it expects the resources at the new location
57 cp ${./Cargo.lock} Cargo.lock
59 mkdir -p frontend-build
60 cp -r ${frontend-build}/* frontend-build
62 substituteInPlace tauri.conf.json --replace-fail '"distDir": "../dist"' '"distDir": "./frontend-build"'
64 # Copy pdu binary from nixpkgs, since the default packaged binary has issues.
65 cp ${parallel-disk-usage}/bin/pdu bin/pdu-${stdenv.hostPlatform.config}
68 nativeBuildInputs = [pkg-config wrapGAppsHook3 copyDesktopItems];
69 buildInputs = [dbus openssl freetype libsoup gtk3 webkitgtk];
71 # Disable checkPhase, since the project doesn't contain tests
75 mv $out/bin/squirreldisk-tauri $out/bin/squirreldisk
76 install -DT icons/256x256.png $out/share/icons/hicolor/256x256/apps/squirrel-disk.png
77 install -DT icons/128x128@2x.png $out/share/icons/hicolor/128x128@2/apps/squirrel-disk.png
78 install -DT icons/128x128.png $out/share/icons/hicolor/128x128/apps/squirrel-disk.png
79 install -DT icons/32x32.png $out/share/icons/hicolor/32x32/apps/squirrel-disk.png
82 # WEBKIT_DISABLE_COMPOSITING_MODE essential in NVIDIA + compositor https://github.com/NixOS/nixpkgs/issues/212064#issuecomment-1400202079
84 wrapProgram "$out/bin/squirreldisk" \
85 --set WEBKIT_DISABLE_COMPOSITING_MODE 1
90 name = "SquirrelDisk";
91 exec = "squirreldisk";
92 icon = "squirrel-disk";
93 desktopName = "SquirrelDisk";
94 comment = meta.description;
99 description = "Cross-platform disk usage analysis tool";
100 homepage = "https://www.squirreldisk.com/";
101 license = licenses.agpl3Only;
102 maintainers = with maintainers; [peret];
103 mainProgram = "squirreldisk";