memos: adapt update script to new nix-prefetch-github
This commit is contained in:
parent
68d6f72e59
commit
412b28f7b2
2 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,7 @@ let
|
|||
owner = "usememos";
|
||||
repo = "memos";
|
||||
rev = "v${version}";
|
||||
sha256 = "lcOZg5mlFPp04ZCm5GDhQfSwE2ahSmGhmdAw+pygK0A=";
|
||||
hash = "sha256-lcOZg5mlFPp04ZCm5GDhQfSwE2ahSmGhmdAw+pygK0A=";
|
||||
};
|
||||
|
||||
frontend = buildNpmPackage {
|
||||
|
@ -32,7 +32,7 @@ buildGoModule rec {
|
|||
|
||||
# check will unable to access network in sandbox
|
||||
doCheck = false;
|
||||
vendorSha256 = "sha256-UM/xeRvfvlq+jGzWpc3EU5GJ6Dt7RmTbSt9h3da6f8w=";
|
||||
vendorHash = "sha256-UM/xeRvfvlq+jGzWpc3EU5GJ6Dt7RmTbSt9h3da6f8w=";
|
||||
|
||||
# Inject frontend assets into go embed
|
||||
prePatch = ''
|
||||
|
|
|
@ -34,12 +34,12 @@ sed -e "s/version =.*;/version = \"$TARGET_VERSION\";/g" \
|
|||
|
||||
# update hash
|
||||
SRC_HASH="$(nix-instantiate --eval -A memos.src.outputHash | tr -d '"')"
|
||||
NEW_HASH="$(nix-prefetch-github usememos memos --rev v$TARGET_VERSION | jq -r .sha256)"
|
||||
NEW_HASH="$(nix-prefetch-github usememos memos --rev v$TARGET_VERSION | jq -r .hash)"
|
||||
|
||||
replaceHash "$SRC_HASH" "$NEW_HASH"
|
||||
|
||||
GO_HASH="$(nix-instantiate --eval -A memos.vendorSha256 | tr -d '"')"
|
||||
EMPTY_HASH="$(nix-instantiate --eval -A lib.fakeSha256 | tr -d '"')"
|
||||
GO_HASH="$(nix-instantiate --eval -A memos.vendorHash | tr -d '"')"
|
||||
EMPTY_HASH="$(nix-instantiate --eval -A lib.fakeHash | tr -d '"')"
|
||||
replaceHash "$GO_HASH" "$EMPTY_HASH"
|
||||
replaceHash "$EMPTY_HASH" "$(extractVendorHash "$GO_HASH")"
|
||||
|
||||
|
|
Loading…
Reference in a new issue