1{
2 runCommand,
3 lib,
4 makeWrapper,
5 fetchFromGitHub,
6
7 coreutils,
8 git,
9 gnugrep,
10 gnused,
11 openssh,
12 inotify-tools,
13}:
14runCommand "gitwatch"
15 rec {
16 version = "0.3";
17 src = fetchFromGitHub {
18 owner = "gitwatch";
19 repo = "gitwatch";
20 rev = "v${version}";
21 hash = "sha256-dKXKuqUQhFUXMwPs7Uilzn2yKH6DIlBTOFztKo+PqVU=";
22 };
23 nativeBuildInputs = [ makeWrapper ];
24
25 meta = {
26 description = "Watch a filesystem and automatically stage changes to a git";
27 mainProgram = "gitwatch";
28 longDescription = ''
29 A bash script to watch a file or folder and commit changes to a git repo.
30 '';
31 homepage = "https://github.com/gitwatch/gitwatch";
32 changelog = "https://github.com/gitwatch/gitwatch/releases/tag/v${version}";
33 license = lib.licenses.gpl3Only;
34 maintainers = with lib.maintainers; [ shved ];
35 };
36 }
37 ''
38 mkdir -p $out/bin
39 dest="$out/bin/gitwatch"
40 cp "$src/gitwatch.sh" $dest
41 chmod +x $dest
42 patchShebangs $dest
43
44 wrapProgram $dest \
45 --prefix PATH ';' ${
46 lib.makeBinPath [
47 coreutils
48 git
49 gnugrep
50 gnused
51 inotify-tools
52 openssh
53 ]
54 }
55 ''