nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 kubectl,
6 stdenv,
7}:
8
9buildGoModule rec {
10 pname = "gsctl";
11 version = "1.1.6";
12
13 src = fetchFromGitHub {
14 owner = "giantswarm";
15 repo = "gsctl";
16 rev = version;
17 sha256 = "sha256-eemPsrSFwgUR1Jz7283jjwMkoJR38QiaiilI9G0IQuo=";
18 };
19
20 vendorHash = "sha256-6b4H8YAY8d/qIGnnGPYZoXne1LXHLsc0OEq0lCeqivo=";
21
22 patches = [
23 ./go120-compatibility.patch
24 ];
25
26 postPatch = ''
27 # fails on sandbox
28 rm commands/root_test.go
29 '';
30
31 ldflags = [
32 "-s"
33 "-w"
34 "-X github.com/giantswarm/gsctl/buildinfo.Version=${version}"
35 ];
36
37 nativeCheckInputs = [
38 kubectl
39 ];
40
41 doCheck = !stdenv.hostPlatform.isDarwin;
42
43 meta = with lib; {
44 description = "Giant Swarm command line interface";
45 homepage = "https://github.com/giantswarm/gsctl";
46 license = licenses.asl20;
47 maintainers = with maintainers; [ joesalisbury ];
48 mainProgram = "gsctl";
49 };
50}