-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
63 lines (49 loc) · 1.64 KB
/
flake.nix
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "Utility for bumping and pushing git tags";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lastTag = "v0.3.1";
revision =
if (self ? shortRev)
then "${self.shortRev}"
else "${self.dirtyShortRev or "dirty"}";
# Add the commit to the version string for flake builds
version = "${lastTag}";
# Run `make vendor-hash` to update the vendor-hash
vendorHash =
if builtins.pathExists ./vendor-hash
then builtins.readFile ./vendor-hash
else "";
buildGoModule = pkgs.buildGo123Module;
in
{
inherit self;
packages.default = buildGoModule {
pname = "bump";
inherit version vendorHash;
src = ./.;
subpackage = [ ./cmd/bump ];
ldflags = [
"-s"
"-w"
"-X github.com/mrvinkel/bump/cmd/bump/internal.BumpVersion=${version}"
];
# Disable tests if they require network access or are integration tests
doCheck = false;
nativeBuildInputs = [ pkgs.installShellFiles ];
meta = with pkgs.lib; {
description = "Utility for bumping and pushing git tags";
homepage = "https://github.com/mrvinkel/bump";
license = licenses.unlicense;
maintainers = with maintainers; [ mrvinkel ];
};
};
}
);
}