16 , libayatana-appindicator
24 stdenv.mkDerivation rec {
28 src = fetchFromGitHub {
32 hash = "sha256-ZpN+SgBq2vA2p4MjrT07j22VB67FdiXIIl9puGiGJA4=";
35 sourceRoot = "${src.name}/src-tauri";
38 substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
39 --replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
42 pnpm-deps = stdenvNoCC.mkDerivation {
43 pname = "${pname}-pnpm-deps";
53 export HOME=$(mktemp -d)
54 pnpm config set store-dir $out
55 # use --ignore-script and --no-optional to avoid downloading binaries
56 # use --frozen-lockfile to avoid checking git deps
57 pnpm install --frozen-lockfile --no-optional --ignore-script
59 # Remove timestamp and sort the json files
61 for f in $(find $out -name "*.json"); do
62 sed -i -E -e 's/"checkedAt":[0-9]+,//g' $f
63 jq --sort-keys . $f | sponge $f
68 outputHashMode = "recursive";
69 outputHash = "sha256-PqdwoGPsu1j4sDTvBAguDhB2v1yaNWybluLiN37SDa4=";
72 cargoDeps = rustPlatform.importCargoLock {
73 lockFile = ./Cargo.lock;
75 # All other crates in the same workspace reuse this hash.
76 "tauri-plugin-autostart-0.0.0" = "sha256-wgVsF3H9BT8lBew7tQ308eIQ6cLZT93hD/4eYCDEq98=";
77 "tauri-plugin-sql-0.0.0" = "sha256-e9iwcHwW8MaRzkaAbewrq6b9+n3ZofMTBnvA23ZF2ro=";
82 rustPlatform.cargoSetupHook
94 libayatana-appindicator
100 ESBUILD_BINARY_PATH = "${lib.getExe (esbuild.override {
101 buildGoModule = args: buildGoModule (args // rec {
103 src = fetchFromGitHub {
107 hash = "sha256-mED3h+mY+4H465m02ewFK/BgA1i/PQ+ksUNxBlgpUoI=";
109 vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
114 export HOME=$(mktemp -d)
115 pnpm config set store-dir ${pnpm-deps}
117 pnpm install --offline --frozen-lockfile --no-optional --ignore-script
118 chmod -R +w ../node_modules
120 # Use cargo-tauri from nixpkgs instead of pnpm tauri from npm
121 cargo tauri build -b deb
125 mv target/release/bundle/deb/*/data/usr/ $out
129 description = "A cross-platform translation software";
130 homepage = "https://pot.pylogmon.com";
131 platforms = platforms.linux;
132 license = licenses.gpl3Only;
133 maintainers = with maintainers; [ linsui ];