about summary refs log tree commit diff
path: root/pkgs/by-name/ta/tana/package.nix
blob: d464b55c2a92984e86eba465ef5524f91651a2cf (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{ libX11
, libxcb
, libXcomposite
, libXdamage
, libXext
, libXfixes
, libXrandr
, stdenv
, lib
, alsa-lib
, at-spi2-atk
, atkmm
, cairo
, cups
, dbus
, expat
, glib
, gtk3
, libdrm
, libglvnd
, libxkbcommon
, mesa
, nspr
, nss
, pango
, systemd
, fetchurl
, autoPatchelfHook
, dpkg
}:
let
  glLibs = [ libglvnd mesa ];
  libs = [
    alsa-lib
    atkmm
    at-spi2-atk
    cairo
    cups
    dbus
    expat
    glib
    gtk3
    libdrm
    libX11
    libxcb
    libXcomposite
    libXdamage
    libXext
    libXfixes
    libxkbcommon
    libXrandr
    nspr
    nss
    pango
  ];
  buildInputs = glLibs ++ libs;
  runpathPackages = glLibs ++ [ stdenv.cc.cc stdenv.cc.libc ];
  version = "1.0.15";
in
stdenv.mkDerivation {
  pname = "tana";
  inherit version buildInputs;

  src = fetchurl {
    url = "https://github.com/tanainc/tana-desktop-releases/releases/download/v${version}/tana_${version}_amd64.deb";
    hash = "sha256-94AyAwNFN5FCol97US1Pv8IN1+WMRA3St9kL2w+9FJU=";
  };

  nativeBuildInputs = [
    autoPatchelfHook
    dpkg
  ];

  appendRunpaths = map (pkg: "${lib.getLib pkg}/lib") runpathPackages ++ [ "${placeholder "out"}/lib/tana" ];

  # Needed for Zygote
  runtimeDependencies = [
    systemd
  ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out
    cp -r usr/* $out
    runHook postInstall
  '';

  postFixup = ''
    substituteInPlace $out/share/applications/tana.desktop \
      --replace "Exec=tana" "Exec=$out/bin/tana" \
      --replace "Name=tana" "Name=Tana"
  '';

  meta = with lib; {
    description = "Tana is an intelligent all-in-one workspace";
    longDescription = ''
      At its core, Tana is an outline editor which can be extended to
      cover multiple use-cases and different workflows.
      For individuals, it supports GTD, P.A.R.A., Zettelkasten note-taking
      out of the box. Teams can leverage the powerful project management
      views, like Kanban.
      To complete all, a powerful AI system is integrated to help with most
      of the tasks.
    '';
    homepage = "https://tana.inc";
    changelog = "https://tana.inc/releases";
    license = licenses.unfree;
    maintainers = [ maintainers.massimogengarelli ];
    platforms = platforms.linux;
    mainProgram = "tana";
  };
}