Skip to content

Commit a57d552

Browse files
committed
refactor flake.nix parser
1 parent 29e30cb commit a57d552

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
name = "coder-${osArch}";
139139
# Updated with ./scripts/update-flake.sh`.
140140
# This should be updated whenever go.mod changes!
141-
vendorHash = "sha256-biJ4rUJ0lmWqUQLAg0QqyIAaLuZ7e//+loWJIefnrNw=";
141+
vendorHash = "sha256-QKgwsJaESo3/7Q5+Fntl2uK6idkn8BT6EAHO8IYlMJQ=";
142142
proxyVendor = true;
143143
src = ./.;
144144
nativeBuildInputs = with pkgs; [ getopt openssl zstd ];
@@ -172,6 +172,7 @@
172172
'';
173173
};
174174
packages = {
175+
proto_gen_go = proto_gen_go_1_30;
175176
all = pkgs.buildEnv {
176177
name = "all-packages";
177178
paths = devShellPackages;

scripts/update-flake.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ sed -i "s#\(vendorHash = \"\)[^\"]*#\1${HASH}#" ./flake.nix
3232

3333
# Update protoc-gen-go sha256
3434
echo "Updating protoc-gen-go sha256..."
35-
PROTOC_GEN_GO_REV=$(grep -A 20 'pkgs.buildGoModule rec' flake.nix | grep -A 10 'repo = "protobuf-go"' | grep 'rev = "v' | sed 's/.*rev = "\(.*\)".*/\1/')
35+
PROTOC_GEN_GO_REV=$(nix eval --extra-experimental-features nix-command --extra-experimental-features flakes --raw .#proto_gen_go.rev)
3636
echo "protoc-gen-go version: $PROTOC_GEN_GO_REV"
3737
PROTOC_GEN_GO_SHA256=$(nix-prefetch-git https://github.com/protocolbuffers/protobuf-go --rev "$PROTOC_GEN_GO_REV" | jq -r .hash)
3838
sed -i "s#\(sha256 = \"\)[^\"]*#\1${PROTOC_GEN_GO_SHA256}#" ./flake.nix

0 commit comments

Comments
 (0)