nixos-config/pkgs/memo/default.nix

51 lines
1.7 KiB
Nix
Raw Normal View History

2019-12-20 05:54:26 +01:00
{ fetchFromGitHub, silver-searcher, tree, man, stdenv, git, pandocSupport ? true
, pandoc ? null, ... }:
2019-10-24 02:20:38 +02:00
assert pandocSupport -> pandoc != null;
stdenv.mkDerivation rec {
name = "memo-${version}";
version = "0.6";
src = fetchFromGitHub {
2019-12-20 05:54:26 +01:00
owner = "mrVanDalo";
repo = "memo";
rev = "${version}";
2019-10-24 02:20:38 +02:00
sha256 = "1cvjs36f6vxzfz5d63yhyw8j7gdw5hn6cfzccf7ag08lamjhfhbr";
};
installPhase = let
pandocReplacement = if pandocSupport then
"pandoc_cmd=${pandoc}/bin/pandoc"
else
"#pandoc_cmd=pandoc";
in ''
mkdir -p $out/{bin,share/man/man1,share/bash-completion/completions,share/zsh/site-functions}
substituteInPlace memo \
--replace "ack_cmd=ack" "ack_cmd=${silver-searcher}/bin/ag" \
--replace "tree_cmd=tree" "tree_cmd=${tree}/bin/tree" \
--replace "man_cmd=man" "man_cmd=${man}/bin/man" \
--replace "git_cmd=git" "git_cmd=${git}/bin/git" \
--replace "pandoc_cmd=pandoc" "${pandocReplacement}"
mv memo $out/bin/
mv doc/memo.1 $out/share/man/man1/memo.1
mv completion/bash/memo.sh $out/share/bash-completion/completions/memo.sh
mv completion/zsh/_memo $out/share/zsh/site-functions/_memo
'';
meta = {
description = "A simple tool written in bash to memorize stuff";
longDescription = ''
A simple tool written in bash to memorize stuff.
Memo organizes is structured through topics which are folders in ~/memo.
'';
2019-12-20 05:54:26 +01:00
homepage = "http://palovandalo.com/memo/";
downloadPage = "https://github.com/mrVanDalo/memo/releases";
2019-10-24 02:20:38 +02:00
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.mrVanDalo ];
platforms = stdenv.lib.platforms.all;
};
}