about summary refs log tree commit diff
path: root/pkgs/by-name/ti/tidgi/package.nix
blob: 20f0b4a194d14677ac132c03f56f0279aa4d4e8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  lib,
  stdenv,
  fetchurl,
  unzip,
}:
stdenv.mkDerivation rec {
  pname = "tidgi";
  version = "0.9.6";

  src =
    if stdenv.isAarch64
    then
      fetchurl
      {
        url = "https://github.com/tiddly-gittly/TidGi-Desktop/releases/download/v${version}/TidGi-darwin-arm64-${version}.zip";
        hash = "sha256-1Z9lxZZWrUVQEhBO/Kt2AS/uNs2XfihdL0iGrguPQ5g=";
      }
    else
      fetchurl
      {
        url = "https://github.com/tiddly-gittly/TidGi-Desktop/releases/download/v${version}/TidGi-darwin-x64-${version}.zip";
        hash = "sha256-5jHW/QrgzsGQfX4LvsRebdOJPzYTvhtC5mczxp2wPI8=";
      };

  dontBuild = true;

  nativeBuildInputs = [unzip];

  sourceRoot = ".";

  installPhase = ''
    runHook preInstall

    mkdir -p "$out/Applications"
    cp -r *.app "$out/Applications"

    runHook postInstall
  '';

  meta = {
    changelog = "https://github.com/tiddly-gittly/TidGi-Desktop/releases/tag/v${version}";
    description = "Customizable personal knowledge-base and blogging platform with git as backup manager";
    homepage = "https://github.com/tiddly-gittly/TidGi-Desktop";
    license = lib.licenses.mpl20;
    maintainers = with lib.maintainers; [klchen0112];
    platforms = ["aarch64-darwin" "x86_64-darwin"];
    sourceProvenance = with lib.sourceTypes; [binaryNativeCode];
  };
}