16 , libayatana-appindicator
21 rustPlatform.buildRustPackage rec {
22 pname = "cinny-desktop";
23 # We have to be using the same version as cinny-web or this isn't going to work.
26 src = fetchFromGitHub {
28 repo = "cinny-desktop";
30 hash = "sha256-v5D0/EHVQ2xo7TGo+jZoRDBVFczkaZu2ka6QpwV4dpw=";
33 sourceRoot = "${src.name}/src-tauri";
35 # modififying $cargoDepsCopy requires the lock to be vendored
36 cargoLock.lockFile = ./Cargo.lock;
40 assert lib.assertMsg (cinny.version == version) "cinny.version (${cinny.version}) != cinny-desktop.version (${version})";
43 substituteInPlace tauri.conf.json \
44 --replace '"distDir": "../cinny/dist",' '"distDir": "${cinny'}",'
45 substituteInPlace tauri.conf.json \
46 --replace '"cd cinny && npm run build"' '""'
47 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
48 substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
49 --replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
52 postBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
53 cargo tauri build --bundles app --target "${rust.envVars.rustHostPlatform}"
56 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
57 install -DT icons/128x128@2x.png $out/share/icons/hicolor/256x256@2/apps/cinny.png
58 install -DT icons/128x128.png $out/share/icons/hicolor/128x128/apps/cinny.png
59 install -DT icons/32x32.png $out/share/icons/hicolor/32x32/apps/cinny.png
60 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
61 mkdir -p "$out/Applications/"
62 cp -r "target/${rust.envVars.rustHostPlatform}/release/bundle/macos/Cinny.app" "$out/Applications/"
63 ln -sf "$out/Applications/Cinny.app/Contents/MacOS/Cinny" "$out/bin/cinny"
77 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
79 libayatana-appindicator
81 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
83 darwin.apple_sdk.frameworks.WebKit
86 desktopItems = lib.optionals stdenv.hostPlatform.isLinux [
91 desktopName = "Cinny";
92 comment = meta.description;
93 categories = [ "Network" "InstantMessaging" ];
98 description = "Yet another matrix client for desktop";
99 homepage = "https://github.com/cinnyapp/cinny-desktop";
100 maintainers = with maintainers; [ qyriad ];
101 license = licenses.agpl3Only;
102 platforms = platforms.linux ++ platforms.darwin;
103 mainProgram = "cinny";