summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/git-sync/default.nix
blob: add7bfc5526fd38140b62dff29407edbddb681e8 (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
{ lib, stdenv, fetchFromGitHub, coreutils, gnugrep, gnused, makeWrapper, git
}:

stdenv.mkDerivation rec {
  pname = "git-sync";
  version = "20151024";

  src = fetchFromGitHub {
    owner = "simonthum";
    repo = "git-sync";
    rev = "eb9adaf2b5fd65aac1e83d6544b9076aae6af5b7";
    sha256 = "01if8y93wa0mwbkzkzx2v1vqh47zlz4k1dysl6yh5rmppd1psknz";
  };

  nativeBuildInputs = [ makeWrapper ];

  dontBuild = true;

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

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

  fixupPhase = ''
    patchShebangs $out/bin

    wrapProgram $out/bin/git-sync \
      --prefix PATH : "${wrapperPath}"
  '';

  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;
  };
}