summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/git-sync/default.nix
blob: 14696903542b5f884cf44effe728bba17fbce406 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib, stdenv, fetchFromGitHub, coreutils, git, gnugrep, gnused, makeWrapper, inotify-tools }:

stdenv.mkDerivation rec {
  pname = "git-sync";
  version = "unstable-2021-07-14";

  src = fetchFromGitHub {
    owner = "simonthum";
    repo = "git-sync";
    rev = "7d3d34bf3ee2483fba00948f5b97f964b849a590";
    sha256 = "sha256-PuYREW5NBkYF1tlcLTbOI8570nvHn5ifN8OIInfNNxI=";
  };

  nativeBuildInputs = [ makeWrapper ];

  dontBuild = true;

  installPhase = ''
    mkdir -p $out/bin
    cp -a git-* $out/bin/
  '';

  wrapperPath = with lib; makeBinPath [
    inotify-tools
    coreutils
    git
    gnugrep
    gnused
  ];

  postFixup = ''
    wrap_path="${wrapperPath}":$out/bin

    wrapProgram $out/bin/git-sync \
      --prefix PATH : $wrap_path

    wrapProgram $out/bin/git-sync-on-inotify \
      --prefix PATH : $wrap_path
  '';

  meta = {
    description = "A script to automatically synchronize a git repository";
    homepage = "https://github.com/simonthum/git-sync";
    maintainers = with lib.maintainers; [ imalison ];
    license = lib.licenses.cc0;
    platforms = with lib.platforms; unix;
  };
}