-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathflake.nix
More file actions
68 lines (57 loc) · 1.79 KB
/
Copy pathflake.nix
File metadata and controls
68 lines (57 loc) · 1.79 KB
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
64
65
66
67
68
{
description = "spr - Stacked Pull Requests on GitHub";
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};
version = if (self ? rev) then self.shortRev else "dev";
commit = if (self ? rev) then self.rev else "dirty";
date = if (self ? lastModifiedDate) then self.lastModifiedDate else "unknown";
in
{
packages = {
spr = pkgs.buildGoModule {
pname = "spr";
inherit version;
src = self;
vendorHash = "sha256-VB7OJ8UkZ0WhEM5l2wR3xA1yxZcr+G+FLt3MxNY83Tg=";
subPackages = [
"cmd/spr"
"cmd/amend"
"cmd/reword"
];
ldflags = [
"-s" "-w"
"-X main.version=${version}"
"-X main.commit=${commit}"
"-X main.date=${date}"
"-X main.builtBy=nix"
];
postInstall = ''
mv $out/bin/spr $out/bin/git-spr
mv $out/bin/amend $out/bin/git-amend
mv $out/bin/reword $out/bin/spr_reword_helper
'';
meta = with pkgs.lib; {
description = "Stacked Pull Requests on GitHub";
homepage = "https://github.com/ejoffe/spr";
license = licenses.mit;
mainProgram = "git-spr";
};
};
default = self.packages.${system}.spr;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
goreleaser
git
];
};
}
);
}