|
1 | 1 | # ----------------------------------------------------------------------------- |
2 | 2 | # Package: ContextVibes CLI |
3 | | -# Version: 0.7.0-alpha.2 |
| 3 | +# Version: Dynamic (Defaults to 0.7.0-alpha.2, overrides via local.nix) |
4 | 4 | # ----------------------------------------------------------------------------- |
5 | | -{ pkgs }: |
| 5 | +{ pkgs, overrides ? {} }: |
6 | 6 |
|
7 | 7 | let |
| 8 | + # --- Defaults (Tracked in Git) --- |
| 9 | + defaultVersion = "0.7.0-alpha.2"; |
| 10 | + defaultHash = "0n1mchl9nphy1q0rxi9468y2hyp6brvf9iisflycvni20w3v4c4i"; |
| 11 | + |
| 12 | + # --- Resolution Logic --- |
| 13 | + # Use value from local.nix if present, otherwise use default |
| 14 | + version = overrides.CONTEXTVIBES_VERSION or defaultVersion; |
| 15 | + sha256 = overrides.CONTEXTVIBES_HASH or defaultHash; |
| 16 | + |
8 | 17 | # Map Nix system architecture to Go architecture naming |
9 | 18 | arch = if pkgs.stdenv.hostPlatform.isAarch64 then "arm64" else "amd64"; |
10 | 19 | os = "linux"; # IDX is Linux-based |
11 | 20 | in |
12 | 21 | pkgs.stdenv.mkDerivation rec { |
13 | 22 | pname = "contextvibes"; |
14 | | - version = "0.7.0-alpha.2"; |
| 23 | + inherit version; |
15 | 24 |
|
16 | 25 | src = pkgs.fetchurl { |
17 | 26 | # URL format matches GoReleaser: contextvibes_0.7.0-alpha.2_linux_amd64.tar.gz |
18 | 27 | url = "https://github.com/contextvibes/cli/releases/download/v${version}/contextvibes_${version}_${os}_${arch}.tar.gz"; |
19 | | - |
20 | | - # TODO: Update this hash! |
21 | | - # Run: nix-prefetch-url https://github.com/contextvibes/cli/releases/download/v0.7.0-alpha.2/contextvibes_0.7.0-alpha.2_linux_amd64.tar.gz |
22 | | - sha256 = "0n1mchl9nphy1q0rxi9468y2hyp6brvf9iisflycvni20w3v4c4i"; |
| 28 | + inherit sha256; |
23 | 29 | }; |
24 | 30 |
|
25 | 31 | # The archive unpacks into the current directory |
|
0 commit comments