···11+{
22+ lib,
33+ stdenv,
44+ fetchFromGitHub,
55+}:
66+77+stdenv.mkDerivation {
88+ pname = "ondir";
99+ version = "0.2.3";
1010+1111+ src = fetchFromGitHub {
1212+ owner = "alecthomas";
1313+ repo = "ondir";
1414+ rev = "cb2f9f8b21e336165fc0a310d677fda75c8e8513";
1515+ hash = "sha256-XTZKFIzJ3xL8ae3zG8nsMhGWvpvRUAQ2b6q/Q1QvGd0=";
1616+ };
1717+1818+ installPhase = ''
1919+ runHook preInstall
2020+2121+ make DESTDIR="$out" PREFIX= install
2222+ cp scripts.* $out
2323+2424+ runHook postInstall
2525+ '';
2626+2727+ meta = with lib; {
2828+ description = "a small program to automate tasks specific to certain directories";
2929+ longDescription = ''
3030+ It works by executing scripts in directories when you enter and leave them.
3131+ This is done by overriding the shell builtins cd, pushd, and popd,
3232+ which is a manual action.
3333+ The user is required to add a snippet to their shell initialisation file like .bashrc or .profile.
3434+3535+ Which commands are executed on directory entry and leave is done
3636+ in predefined locations with a .ondirrc file.
3737+3838+ See man ondir for more information
3939+ '';
4040+ homepage = "https://github.com/alecthomas/ondir/";
4141+ license = licenses.gpl2Only;
4242+ maintainers = [ maintainers.michaelCTS ];
4343+ };
4444+}