1{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, Security }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "git-backup";
5 version = "0.2.0";
6
7 src = fetchFromGitHub {
8 owner = "jsdw";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "0h31j8clvk4gkw4mgva9p0ypf26zhf7f0y564fdmzyw6rsz9wzcj";
12 };
13
14 cargoLock = {
15 lockFile = ./Cargo.lock;
16 };
17
18 nativeBuildInputs = [ pkg-config ];
19
20 buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
21
22 # update Cargo.lock to work with openssl 3
23 postPatch = ''
24 ln -sf ${./Cargo.lock} Cargo.lock
25 '';
26
27 meta = with lib; {
28 homepage = "https://github.com/jsdw/git-backup";
29 description = "A tool to help you backup your git repositories from services like GitHub";
30 license = licenses.mit;
31 maintainers = with maintainers; [ cafkafk ];
32 mainProgram = "git-backup";
33 };
34}