summary refs log tree commit diff
path: root/pkgs/by-name/ho/hottext/package.nix
blob: e164ff1122f322cb6ce2bdbdb185771940627023 (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
{ lib, nim2Packages, fetchFromSourcehut, gentium, makeDesktopItem, nim_lk, SDL2 }:

nim2Packages.buildNimPackage (finalAttrs: {
  pname = "hottext";
  version = "20231003";

  nimBinOnly = true;

  src = fetchFromSourcehut {
    owner = "~ehmry";
    repo = "hottext";
    rev = finalAttrs.version;
    hash = "sha256-ncH/1PV4vZY7JCUJ87FPz5bdrQsNlYxzGdc5BQNfQeA=";
  };

  buildInputs = [ SDL2 ];

  nimFlags = nim_lk.passthru.nimFlagsFromLockFile ./lock.json;

  HOTTEXT_FONT_PATH = "${gentium}/share/fonts/truetype/GentiumPlus-Regular.ttf";

  desktopItem = makeDesktopItem {
    categories = [ "Utility" ];
    comment = finalAttrs.meta.description;
    desktopName = finalAttrs.pname;
    exec = finalAttrs.pname;
    name = finalAttrs.pname;
  };

  postInstall = ''
    cp -r $desktopItem/* $out
  '';

  meta = finalAttrs.src.meta // {
    description = "Simple RSVP speed-reading utility";
    license = lib.licenses.unlicense;
    homepage = "https://git.sr.ht/~ehmry/hottext";
    maintainers = with lib.maintainers; [ ehmry ];
    mainProgram = "hottext";
  };
})