nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 cwtch,
3 fetchgit,
4 flutter329,
5 lib,
6 tor,
7}:
8let
9 runtimeBinDependencies = [
10 tor
11 ];
12in
13flutter329.buildFlutterApplication rec {
14 pname = "cwtch-ui";
15 version = "1.15.5";
16 # This Gitea instance has archive downloads disabled, so: fetchgit
17 src = fetchgit {
18 url = "https://git.openprivacy.ca/cwtch.im/cwtch-ui";
19 rev = "v${version}";
20 hash = "sha256-u0IFLZp53Fg8soKjSXr6IjNxFI9aTU5xUYgf1SN6rTQ=";
21 };
22
23 # NOTE: The included pubspec.json does not exactly match the upstream
24 # pubspec.lock. With Flutter 3.24, a newer version of material_color_utilities
25 # is required than the upstream locked version. From a checkout of cwtch-ui
26 # 1.15.4, I ran `flutter pub upgrade material_color_utilities` on 2024-12-15.
27 # This upgraded material_color_utilities and its dependencies.
28 pubspecLock = lib.importJSON ./pubspec.json;
29 gitHashes = {
30 flutter_gherkin = "sha256-Y8tR84kkczQPBwh7cGhPFAAqrMZKRfGp/02huPaaQZg=";
31 };
32
33 flutterBuildFlags = [
34 "--dart-define"
35 "BUILD_VER=${version}"
36 "--dart-define"
37 "BUILD_DATE=1980-01-01-00:00"
38 ];
39
40 # These things are added to LD_LIBRARY_PATH, but not PATH
41 runtimeDependencies = [ cwtch ];
42
43 extraWrapProgramArgs = "--prefix PATH : ${lib.makeBinPath runtimeBinDependencies}";
44
45 postInstall = ''
46 mkdir -p $out/share/applications
47 substitute linux/cwtch.template.desktop "$out/share/applications/cwtch.desktop" \
48 --replace-fail PREFIX "$out"
49 '';
50
51 meta = {
52 description = "Messaging app built on the cwtch decentralized, privacy-preserving, multi-party messaging protocol";
53 homepage = "https://cwtch.im/";
54 changelog = "https://docs.cwtch.im/changelog";
55 license = lib.licenses.mit;
56 mainProgram = "cwtch";
57 platforms = [ "x86_64-linux" ];
58 maintainers = [ lib.maintainers.gmacon ];
59 };
60}