Skip to content

Commit 6149e81

Browse files
committed
chore(nix): Enable local version overrides
1 parent 89fac44 commit 6149e81

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

.idx/contextvibes.nix

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
# -----------------------------------------------------------------------------
22
# Package: ContextVibes CLI
3-
# Version: 0.7.0-alpha.2
3+
# Version: Dynamic (Defaults to 0.7.0-alpha.2, overrides via local.nix)
44
# -----------------------------------------------------------------------------
5-
{ pkgs }:
5+
{ pkgs, overrides ? {} }:
66

77
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+
817
# Map Nix system architecture to Go architecture naming
918
arch = if pkgs.stdenv.hostPlatform.isAarch64 then "arm64" else "amd64";
1019
os = "linux"; # IDX is Linux-based
1120
in
1221
pkgs.stdenv.mkDerivation rec {
1322
pname = "contextvibes";
14-
version = "0.7.0-alpha.2";
23+
inherit version;
1524

1625
src = pkgs.fetchurl {
1726
# URL format matches GoReleaser: contextvibes_0.7.0-alpha.2_linux_amd64.tar.gz
1827
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;
2329
};
2430

2531
# The archive unpacks into the current directory

.idx/dev.nix

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ in
4141
gh
4242

4343
# --- Local Imports ---
44-
# Ensure these files return a single derivation (package).
45-
# If they return a list, this syntax needs changing.
46-
(import ./contextvibes.nix { inherit pkgs; })
44+
# We pass 'overrides = localEnv' so contextvibes.nix can read variables from local.nix
45+
(import ./contextvibes.nix { inherit pkgs; overrides = localEnv; })
4746
(import ./golangci-lint.nix { inherit pkgs; })
4847
];
4948

0 commit comments

Comments
 (0)