nixpkgs/pkgs/by-name/gi/git-sync/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

49 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, coreutils, git, gnugrep, gnused, makeWrapper, inotify-tools }:
stdenv.mkDerivation rec {
pname = "git-sync";
version = "0-unstable-2024-02-15";
src = fetchFromGitHub {
owner = "simonthum";
repo = "git-sync";
rev = "493b0155fb974b477b6ea623d6e41e13ddad8500";
hash = "sha256-hsq+kpB+akjbFKBeHMsP8ibrtygEG2Yf2QW9vFFIano=";
};
nativeBuildInputs = [ makeWrapper ];
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
cp -a git-* $out/bin/
cp -a contrib/git-* $out/bin/
'';
wrapperPath = lib.makeBinPath ([
coreutils
git
gnugrep
gnused
] ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ]);
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 = "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;
};
}