mirror of
https://github.com/matter-labs/nixsgx.git
synced 2025-07-22 15:54:47 +02:00
feat: initial commit
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
6fe41c9723
commit
1054e3dbe4
51 changed files with 3521 additions and 1 deletions
29
packages/nodejs/update.nix
Normal file
29
packages/nodejs/update.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ lib
|
||||
, writeScript
|
||||
, coreutils
|
||||
, curl
|
||||
, gnugrep
|
||||
, jq
|
||||
, gnupg
|
||||
, common-updater-scripts
|
||||
, majorVersion
|
||||
, nix
|
||||
, runtimeShell
|
||||
}:
|
||||
|
||||
writeScript "update-nodejs" ''
|
||||
#!${runtimeShell}
|
||||
PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep jq gnupg nix ]}
|
||||
|
||||
HOME=`mktemp -d`
|
||||
cat ${./nodejs-release-keys.asc} | gpg --import
|
||||
|
||||
tags=`curl --silent https://api.github.com/repos/nodejs/node/git/refs/tags`
|
||||
version=`echo $tags | jq -r '.[] | select(.ref | startswith("refs/tags/v${majorVersion}")) | .ref' | sort --version-sort | tail -1 | grep -oP "^refs/tags/v\K.*"`
|
||||
|
||||
curl --silent -o $HOME/SHASUMS256.txt.asc https://nodejs.org/dist/v''${version}/SHASUMS256.txt.asc
|
||||
hash_hex=`gpgv --keyring=$HOME/.gnupg/pubring.kbx --output - $HOME/SHASUMS256.txt.asc | grep -oP "^([0-9a-f]{64})(?=\s+node-v''${version}.tar.xz$)"`
|
||||
hash=`nix-hash --type sha256 --to-base32 ''${hash_hex}`
|
||||
|
||||
update-source-version nodejs-${majorVersion}_x "''${version}" "''${hash}"
|
||||
''
|
Loading…
Add table
Add a link
Reference in a new issue