1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 git,
6 makeWrapper,
7}:
8let
9 pname = "gitopper";
10 version = "0.0.20";
11in
12buildGoModule {
13 inherit pname version;
14
15 src = fetchFromGitHub {
16 owner = "miekg";
17 repo = "gitopper";
18 rev = "v${version}";
19 hash = "sha256-y0gzoXSIQDQ6TMVsAijPaN0sRqFEtTKyd297YxXAukM=";
20 };
21
22 ldflags = [ "-X main.Version=${version}" ];
23
24 vendorHash = "sha256-b9lLOGk0h0kaWuZb142V8ojfpstRhzC9q2kSu0q7r7I=";
25
26 nativeCheckInputs = [
27 makeWrapper
28 git
29 ];
30
31 checkFlags =
32 let
33 # Skip tests that does not works well inside an isolated environment
34 skippedTests = [
35 "TestInitialGitCheckout"
36 "TestHash"
37 ];
38 in
39 [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
40
41 postInstall = ''
42 wrapProgram $out/bin/gitopper \
43 --suffix PATH : ${lib.makeBinPath [ git ]}
44 '';
45
46 meta = {
47 description = "Gitops for non-Kubernetes folks";
48 homepage = "https://github.com/miekg/gitopper/";
49 license = lib.licenses.asl20;
50 platforms = lib.platforms.linux;
51 maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
52 mainProgram = "gitopper";
53 };
54}