about summary refs log tree commit diff
path: root/pkgs/applications/misc/notable/default.nix
blob: 9d1c4a246627cee9d2cc93a9e062aca982a395e1 (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
{ appimageTools, makeWrapper, fetchurl, lib }:

let
  pname = "notable";
  version = "1.8.4";
  sha256 = "0rvz8zwsi62kiq89pv8n2wh9h5yb030kvdr1vf65xwqkhqcrzrby";

  src = fetchurl {
    url = "https://github.com/notable/notable/releases/download/v${version}/Notable-${version}.AppImage";
    inherit sha256;
  };

  appimageContents = appimageTools.extract {
    inherit pname version src;
  };
in
appimageTools.wrapType2 rec {

  inherit pname version src;

  profile = ''
    export LC_ALL=C.UTF-8
  '';

  nativeBuildInputs = [ makeWrapper ];

  extraPkgs = pkgs: [ pkgs.at-spi2-atk pkgs.at-spi2-core ];

  extraInstallCommands = ''
    install -m 444 -D ${appimageContents}/notable.desktop $out/share/applications/notable.desktop
    install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/1024x1024/apps/notable.png \
      $out/share/icons/hicolor/1024x1024/apps/notable.png
    substituteInPlace $out/share/applications/notable.desktop \
      --replace 'Exec=AppRun' 'Exec=${pname}'
    wrapProgram "$out/bin/${pname}" \
      --add-flags "--disable-seccomp-filter-sandbox"
  '';

  meta = with lib; {
    description = "Markdown-based note-taking app that doesn't suck";
    homepage = "https://github.com/notable/notable";
    license = licenses.unfree;
    platforms = [ "x86_64-linux" ];
    maintainers = [ ];
  };
}