forked from Dicklesworthstone/beads_viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
78 lines (66 loc) · 2.31 KB
/
flake.nix
File metadata and controls
78 lines (66 loc) · 2.31 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
69
70
71
72
73
74
75
76
77
78
{
description = "bv - Terminal UI for the Beads issue tracker";
inputs = {
# Use nixpkgs unstable for Go 1.25+ support
# go.mod requires go 1.25, which isn't in stable nixpkgs yet
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
version = "0.11.3";
# To update vendorHash after go.mod/go.sum changes:
# 1. Set vendorHash to: pkgs.lib.fakeHash
# 2. Run: nix build .#bv 2>&1 | grep "got:"
# 3. Replace vendorHash with the hash from "got:"
# Updated to include pgregory.net/rapid and github.com/goccy/go-json dependencies
# If build fails, use fakeHash method documented above to recalculate
vendorHash = "sha256-V8Bl5lW9vd7o1ZcQ6rvs3WJ1ueYX7xKnHTyRAASHlng=";
in
{
packages = {
bv = pkgs.buildGoModule {
pname = "bv";
inherit version;
src = ./.;
inherit vendorHash;
subPackages = [ "cmd/bv" ];
ldflags = [
"-s"
"-w"
"-X github.com/Dicklesworthstone/beads_viewer/pkg/version.Version=v${version}"
];
meta = with pkgs.lib; {
description = "Terminal UI for the Beads issue tracker with graph-aware triage";
homepage = "https://github.com/Dicklesworthstone/beads_viewer";
license = licenses.mit;
maintainers = [ ];
mainProgram = "bv";
platforms = platforms.unix;
};
};
default = self.packages.${system}.bv;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
go-tools
delve
];
shellHook = ''
echo "bv development environment"
echo "Go version: $(go version)"
echo ""
echo "Available commands:"
echo " go build ./cmd/bv - Build bv"
echo " go test ./... - Run tests"
echo " nix build .#bv - Build with Nix"
'';
};
}
);
}