From aab2097d2d6c3440debb3fa06ae6b7e6643c782f Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Fri, 7 Jul 2023 23:02:18 -0700 Subject: [PATCH] tandoor-recipes, tandoor-recipes.frontend: adapt update script to new nix-prefetch-github We also take the opportunity also to migrate from "sha256" and "yarnSha256" attributes to "hash" and "yarnHash" attributes. --- pkgs/applications/misc/tandoor-recipes/common.nix | 4 ++-- pkgs/applications/misc/tandoor-recipes/frontend.nix | 2 +- pkgs/applications/misc/tandoor-recipes/update.sh | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/tandoor-recipes/common.nix b/pkgs/applications/misc/tandoor-recipes/common.nix index 6ae3ede11b1a..7a280285ac5d 100644 --- a/pkgs/applications/misc/tandoor-recipes/common.nix +++ b/pkgs/applications/misc/tandoor-recipes/common.nix @@ -6,10 +6,10 @@ rec { owner = "TandoorRecipes"; repo = "recipes"; rev = version; - sha256 = "sha256-cVrgmRDzuLzl2+4UcrLRdrP6ZFWMkavu9OEogNas2fA="; + hash = "sha256-cVrgmRDzuLzl2+4UcrLRdrP6ZFWMkavu9OEogNas2fA="; }; - yarnSha256 = "sha256-0u9P/OsoThP8gonrzcnO5zhIboWMI1mTsXHlbt7l9oE="; + yarnHash = "sha256-0u9P/OsoThP8gonrzcnO5zhIboWMI1mTsXHlbt7l9oE="; meta = with lib; { homepage = "https://tandoor.dev/"; diff --git a/pkgs/applications/misc/tandoor-recipes/frontend.nix b/pkgs/applications/misc/tandoor-recipes/frontend.nix index 98da59a1d299..dd6380449d95 100644 --- a/pkgs/applications/misc/tandoor-recipes/frontend.nix +++ b/pkgs/applications/misc/tandoor-recipes/frontend.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { yarnOfflineCache = fetchYarnDeps { yarnLock = "${common.src}/vue/yarn.lock"; - sha256 = common.yarnSha256; + hash = common.yarnHash; }; nativeBuildInputs = [ diff --git a/pkgs/applications/misc/tandoor-recipes/update.sh b/pkgs/applications/misc/tandoor-recipes/update.sh index 49b6d5f98ae9..63021d76f6b7 100755 --- a/pkgs/applications/misc/tandoor-recipes/update.sh +++ b/pkgs/applications/misc/tandoor-recipes/update.sh @@ -23,7 +23,7 @@ fi package_src="https://raw.githubusercontent.com/TandoorRecipes/recipes/$version" -src_hash=$(nix-prefetch-github TandoorRecipes recipes --rev "${version}" | jq -r .sha256) +src_hash=$(nix-prefetch-github TandoorRecipes recipes --rev "${version}" | jq -r .hash) tmpdir=$(mktemp -d) trap 'rm -rf "$tmpdir"' EXIT @@ -34,9 +34,8 @@ yarn_hash=$(prefetch-yarn-deps yarn.lock) popd # Use friendlier hashes -src_hash=$(nix hash to-sri --type sha256 "$src_hash") yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash") sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix -sed -i -E -e "s#sha256 = \".*\"#sha256 = \"$src_hash\"#" common.nix -sed -i -E -e "s#yarnSha256 = \".*\"#yarnSha256 = \"$yarn_hash\"#" common.nix +sed -i -E -e "s#hash = \".*\"#hash = \"$src_hash\"#" common.nix +sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" common.nix