Merge remote-tracking branch 'ni/master'
This commit is contained in:
commit
2d9c74b4f3
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
/.graveyard
|
/.graveyard
|
||||||
|
/TODO
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
- /.git
|
- /.git
|
||||||
- /.graveyard
|
- /.graveyard
|
||||||
|
- /TODO
|
||||||
P /.version-suffix
|
P /.version-suffix
|
||||||
|
|
|
@ -8,7 +8,6 @@ with import <stockholm/lib>;
|
||||||
<stockholm/tv/2configs/hw/w110er.nix>
|
<stockholm/tv/2configs/hw/w110er.nix>
|
||||||
<stockholm/tv/2configs/exim-retiolum.nix>
|
<stockholm/tv/2configs/exim-retiolum.nix>
|
||||||
<stockholm/tv/2configs/gitrepos.nix>
|
<stockholm/tv/2configs/gitrepos.nix>
|
||||||
<stockholm/tv/2configs/im.nix>
|
|
||||||
<stockholm/tv/2configs/mail-client.nix>
|
<stockholm/tv/2configs/mail-client.nix>
|
||||||
<stockholm/tv/2configs/man.nix>
|
<stockholm/tv/2configs/man.nix>
|
||||||
<stockholm/tv/2configs/nginx/public_html.nix>
|
<stockholm/tv/2configs/nginx/public_html.nix>
|
||||||
|
|
|
@ -24,6 +24,10 @@ foldl' mergeAttrs {}
|
||||||
"$@"
|
"$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
gitAndTools = super.gitAndTools // {
|
||||||
|
inherit (self) diff-so-fancy;
|
||||||
|
};
|
||||||
|
|
||||||
ff = self.writeDashBin "ff" ''
|
ff = self.writeDashBin "ff" ''
|
||||||
exec ${self.firefoxWrapper}/bin/firefox "$@"
|
exec ${self.firefoxWrapper}/bin/firefox "$@"
|
||||||
'';
|
'';
|
||||||
|
|
48
tv/5pkgs/simple/diff-so-fancy.nix
Normal file
48
tv/5pkgs/simple/diff-so-fancy.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "diff-so-fancy-${version}";
|
||||||
|
version = "ed8cf17";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "so-fancy";
|
||||||
|
repo = "diff-so-fancy";
|
||||||
|
rev = "ed8cf1763d38bdd79ceb55a73b9ce7e30f1e184d";
|
||||||
|
sha256 = "176qn0w2rn6mr5ymvkblyiznqq7yyibfsnnjfivcyhz69w6yr9r9";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Perl is needed here for patchShebangs
|
||||||
|
nativeBuildInputs = [ perl makeWrapper ];
|
||||||
|
|
||||||
|
buildPhase = null;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin $out/lib/diff-so-fancy
|
||||||
|
|
||||||
|
# diff-so-fancy executable searches for it's library relative to
|
||||||
|
# itself, so we are copying executable to lib, and only symlink it
|
||||||
|
# from bin/
|
||||||
|
cp diff-so-fancy $out/lib/diff-so-fancy
|
||||||
|
cp -r lib $out/lib/diff-so-fancy
|
||||||
|
ln -s $out/lib/diff-so-fancy/diff-so-fancy $out/bin
|
||||||
|
|
||||||
|
# ncurses is needed for `tput`
|
||||||
|
wrapProgram $out/lib/diff-so-fancy/diff-so-fancy \
|
||||||
|
--prefix PATH : "${git}/share/git/contrib/diff-highlight" \
|
||||||
|
--prefix PATH : "${git}/bin" \
|
||||||
|
--prefix PATH : "${coreutils}/bin" \
|
||||||
|
--prefix PATH : "${ncurses.out}/bin"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = https://github.com/so-fancy/diff-so-fancy;
|
||||||
|
description = "Good-looking diffs filter for git";
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.all;
|
||||||
|
longDescription = ''
|
||||||
|
diff-so-fancy builds on the good-lookin' output of git contrib's
|
||||||
|
diff-highlight to upgrade your diffs' appearances.
|
||||||
|
'';
|
||||||
|
maintainers = with maintainers; [ fpletz ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -262,7 +262,7 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-todo = ''
|
q-todo = ''
|
||||||
TODO_file=$HOME/TODO
|
TODO_file=$PWD/TODO
|
||||||
if test -e "$TODO_file"; then
|
if test -e "$TODO_file"; then
|
||||||
${pkgs.coreutils}/bin/cat "$TODO_file" \
|
${pkgs.coreutils}/bin/cat "$TODO_file" \
|
||||||
| ${pkgs.gawk}/bin/gawk -v now=$(${pkgs.coreutils}/bin/date +%s) '
|
| ${pkgs.gawk}/bin/gawk -v now=$(${pkgs.coreutils}/bin/date +%s) '
|
||||||
|
@ -294,13 +294,7 @@ in
|
||||||
pkgs.writeBashBin "q" ''
|
pkgs.writeBashBin "q" ''
|
||||||
set -eu
|
set -eu
|
||||||
export PATH=/var/empty
|
export PATH=/var/empty
|
||||||
(${q-todo}) || :
|
|
||||||
if [ "$PWD" != "$HOME" ]; then
|
|
||||||
(HOME=$PWD; ${q-todo}) || :
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
${q-cal}
|
${q-cal}
|
||||||
echo
|
|
||||||
${q-isodate}
|
${q-isodate}
|
||||||
${q-sgtdate}
|
${q-sgtdate}
|
||||||
(${q-gitdir}) &
|
(${q-gitdir}) &
|
||||||
|
@ -311,4 +305,14 @@ pkgs.writeBashBin "q" ''
|
||||||
(${q-online}) &
|
(${q-online}) &
|
||||||
(${q-thermal_zone}) &
|
(${q-thermal_zone}) &
|
||||||
wait
|
wait
|
||||||
|
if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then
|
||||||
|
TODO_home_entries=$(cd; (${q-todo}) | ${pkgs.coreutils}/bin/wc -l)
|
||||||
|
if test "$TODO_home_entries" = 1; then
|
||||||
|
TODO_format='There is %d entry in ~/TODO'
|
||||||
|
else
|
||||||
|
TODO_format='There are %d entries in ~/TODO'
|
||||||
|
fi
|
||||||
|
printf "\x1b[38;5;238m$TODO_format\x1b[m\n" "$TODO_home_entries"
|
||||||
|
fi
|
||||||
|
(${q-todo}) || :
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in a new issue