From 24e8a12f229f86c08ec00d86b3986c6466eb9692 Mon Sep 17 00:00:00 2001 From: MayNiklas Date: Sun, 31 Mar 2024 10:40:30 +0200 Subject: [PATCH] migrate to vendorHash --- .github/workflows/update-vendor-hash.yml | 4 ++-- flake.lock | 12 ++++++------ flake.nix | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-vendor-hash.yml b/.github/workflows/update-vendor-hash.yml index a0ced36..e62b3bc 100644 --- a/.github/workflows/update-vendor-hash.yml +++ b/.github/workflows/update-vendor-hash.yml @@ -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 diff --git a/flake.lock b/flake.lock index a7fe431..491e53f 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694767346, - "narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ace5093e36ab1e95cb9463863491bee90d5a4183", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 78f2ddf..d2150ea 100644 --- a/flake.nix +++ b/flake.nix @@ -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