nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 fetchFromGitHub,
3 silver-searcher,
4 tree,
5 man,
6 lib,
7 stdenv,
8 git,
9 pandocSupport ? true,
10 pandoc ? null,
11 ...
12}:
13
14assert pandocSupport -> pandoc != null;
15
16stdenv.mkDerivation rec {
17
18 pname = "memo";
19
20 version = "0.8";
21
22 src = fetchFromGitHub {
23 owner = "mrVanDalo";
24 repo = "memo";
25 rev = version;
26 sha256 = "0azx2bx6y7j0637fg3m8zigcw09zfm2mw9wjfg218sx88cm1wdkp";
27 };
28
29 installPhase =
30 let
31 pandocReplacement =
32 if pandocSupport then "pandoc_cmd=${pandoc}/bin/pandoc" else "#pandoc_cmd=pandoc";
33 in
34 ''
35 mkdir -p $out/{bin,share/man/man1,share/bash-completion/completions,share/zsh/site-functions}
36 substituteInPlace memo \
37 --replace "ack_cmd=ack" "ack_cmd=${silver-searcher}/bin/ag" \
38 --replace "tree_cmd=tree" "tree_cmd=${tree}/bin/tree" \
39 --replace "man_cmd=man" "man_cmd=${man}/bin/man" \
40 --replace "git_cmd=git" "git_cmd=${git}/bin/git" \
41 --replace "pandoc_cmd=pandoc" "${pandocReplacement}"
42 mv memo $out/bin/
43 mv doc/memo.1 $out/share/man/man1/memo.1
44 mv completion/bash/memo.sh $out/share/bash-completion/completions/memo.sh
45 mv completion/zsh/_memo $out/share/zsh/site-functions/_memo
46 '';
47
48 meta = {
49 description = "Simple tool written in bash to memorize stuff";
50 longDescription = ''
51 A simple tool written in bash to memorize stuff.
52 Memo organizes is structured through topics which are folders in ~/memo.
53 '';
54 homepage = "http://palovandalo.com/memo/";
55 downloadPage = "https://github.com/mrVanDalo/memo/releases";
56 license = lib.licenses.gpl3;
57 maintainers = [ lib.maintainers.mrVanDalo ];
58 platforms = lib.platforms.all;
59 mainProgram = "memo";
60 };
61}