M .config/git/config => .config/git/config +1 -0
@@ 58,6 58,7 @@
vertical-split = false
[tig "bind"]
main = R !git revert %(commit)
+ main = _ !git tag -f _ %(commit)
[tar "tar.xz"]
command = xz -c
[tar "tar.gz"]
A bin/nix-edit => bin/nix-edit +20 -0
@@ 0,0 1,20 @@
+#!/bin/sh -eu
+# Nix provides convenient "nix edit" command that opens file containing
+# definition of specified attribute (package). Unfortunately, it works very
+# slow on "espero" box (probably due a i/o activity and hdd drive), so this
+# script caches result and opens cached path in editor on subsequent calls.
+#
+# Cache invalidation is hard problem, and I don't even attempt to solve it.
+# Luckily, stuff rarely moves around in nixpkgs.
+readonly cachedir=~/.cache/nix-edit
+name=$1
+cache="${cachedir}/${name}"
+
+if ! test -f "${cache}" ; then
+ mkdir -p "${cachedir}"
+ if ! EDITOR=echo nix edit ".#${name}" > "${cache}" ; then
+ rm -f "${cache}"
+ exit 1
+ fi
+fi
+exec $EDITOR "$(cat "${cache}")"