Skip to content

Commit

Permalink
migrate to vendorHash
Browse files Browse the repository at this point in the history
  • Loading branch information
MayNiklas committed Mar 31, 2024
1 parent d5cce50 commit 24e8a12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-vendor-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- name: Update checksum
run: |
failedbuild=$(nix build --impure --expr "((builtins.getFlake \"$(pwd)#\").packages.\${builtins.currentSystem}.shelly-exporter.override { vendorSha256 = \"\"; })" 2>&1 || true)
failedbuild=$(nix build --impure --expr "((builtins.getFlake \"$(pwd)#\").packages.\${builtins.currentSystem}.shelly-exporter.override { vendorHash = \"\"; })" 2>&1 || true)
checksum=$(echo "$failedbuild" | awk '/got:.*sha256/ { print $2 }')
sed -i -e "s|{ vendorSha256 ? \".*\"|{ vendorSha256 ? \"$checksum\"|" flake.nix
sed -i -e "s|{ vendorHash ? \".*\"|{ vendorHash ? \"$checksum\"|" flake.nix
# git push if we have a diff
if [[ -n $(git diff) ]]; then
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@
shelly-exporter =
let
package =
{ vendorSha256 ? "sha256-ZkhGkv3rJLDsDkpQ/cuA6PKt1pMjY5otzmjXxq+/bIk="
{ vendorHash ? "sha256-ZkhGkv3rJLDsDkpQ/cuA6PKt1pMjY5otzmjXxq+/bIk="
, ...
}:
pkgs.buildGoModule rec {
pname = "shelly-exporter";
version = "1.0.6";
src = self;
inherit vendorSha256;
inherit vendorHash;
installCheckPhase = ''
runHook preCheck
$out/bin/shelly-exporter -h
Expand Down

0 comments on commit 24e8a12

Please sign in to comment.