aboutsummaryrefslogtreecommitdiff
path: root/pkgs/plato/default.nix
blob: 2c7b5dfc0a71d574126f8333194560d859658683 (plain)
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
{ stdenvNoCC, fetchzip, lib, ... }:
let
  version = "0.9.43";
in stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "plato";
  inherit version;

  src = fetchzip {
    url = "https://github.com/baskerville/plato/releases/download/${finalAttrs.version}/plato-${finalAttrs.version}.zip";
    stripRoot = false;
    hash = "sha256-1E9trfAF3w0+ix8JVDJwYjWQ/dfsLjLPmkCLJAYXkZU=";
  };

  picSrc = fetchzip {
    url = "https://github.com/baskerville/plato/archive/refs/tags/${version}.zip";
    hash = "sha256-u9d/8C9rRb0glZR07tqz/d8EXO0bRddXlCFDje7ow2Y=";
  };

  outputs = [
    "out"
    "KoboRoot"
    "png"
  ];

  phases = "installPhase";

  installPhase = ''
    runHook preInstall

    cp -r $src $out

    mkdir $KoboRoot

    cp $picSrc/artworks/plato.png $png

    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/baskerville/plato";
    platform = platforms.all;
    license = licenses.agpl3Plus;
    outputsToInstall = finalAttrs.outputs;
  };
})