about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/admin/hedgedoc-cli/default.nix
blob: 8f68e50ebcf8ac2c9a286022a06997d28462fe8b (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
{ lib, stdenv, fetchFromGitHub, wget, jq, curl }:

let
  version = "1.0";
in
stdenv.mkDerivation {
  pname = "hedgedoc-cli";
  inherit version;

  src = fetchFromGitHub {
    owner = "hedgedoc";
    repo = "cli";
    rev = "v${version}";
    sha256 = "uz+lkRRUTRr8WR295esNEbgjlZ/Em7mBk6Nx0BWLfg4=";
  };

  buildInputs = [
    wget
    jq
    curl
  ];

  installPhase = ''
    runHook preInstall
    install -Dm0755 -t $out/bin $src/bin/codimd
    ln -s $out/bin/codimd $out/bin/hedgedoc-cli
    runHook postInstall
  '';

  checkPhase = ''
    hedgedoc-cli help
  '';

  meta = with lib; {
    description = "Hedgedoc CLI";
    homepage = "https://github.com/hedgedoc/cli";
    license = licenses.agpl3;
    maintainers = with maintainers; [ drupol ];
  };
}