1{ appimageTools, symlinkJoin, lib, fetchurl, makeDesktopItem }:
2
3let
4 pname = "ssb-patchwork";
5 version = "3.18.1";
6 name = "Patchwork-${version}";
7
8 src = fetchurl {
9 url = "https://github.com/ssbc/patchwork/releases/download/v${version}/${name}.AppImage";
10 sha256 = "F8n6LLbgkg3z55lSY60T+pn2lra8aPt6Ztepw1gf2rI=";
11 };
12
13 binary = appimageTools.wrapType2 {
14 name = pname;
15 inherit src;
16 };
17 # we only use this to extract the icon
18 appimage-contents = appimageTools.extractType2 {
19 inherit name src;
20 };
21
22 desktopItem = makeDesktopItem {
23 name = "ssb-patchwork";
24 exec = "${binary}/bin/ssb-patchwork";
25 icon = "ssb-patchwork.png";
26 comment = "Client for the decentralized social network Secure Scuttlebutt";
27 desktopName = "Patchwork";
28 genericName = "Patchwork";
29 categories = "Network;";
30 };
31
32in
33 symlinkJoin {
34 inherit name;
35 paths = [ binary ];
36
37 postBuild = ''
38 mkdir -p $out/share/pixmaps/ $out/share/applications
39 cp ${appimage-contents}/ssb-patchwork.png $out/share/pixmaps
40 cp ${desktopItem}/share/applications/* $out/share/applications/
41 '';
42
43 meta = with lib; {
44 description = "A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB)";
45 longDescription = ''
46 sea-slang for gossip - a scuttlebutt is basically a watercooler on a ship.
47 '';
48 homepage = "https://www.scuttlebutt.nz/";
49 license = licenses.agpl3;
50 maintainers = with maintainers; [ asymmetric ninjatrappeur cyplo ];
51 platforms = [ "x86_64-linux" ];
52 };
53 }