Skip to content

Instantly share code, notes, and snippets.

@MatrixManAtYrService
Created July 22, 2024 02:24
Show Gist options
  • Save MatrixManAtYrService/1a43c864a635ff4085e4a31be5846245 to your computer and use it in GitHub Desktop.
Save MatrixManAtYrService/1a43c864a635ff4085e4a31be5846245 to your computer and use it in GitHub Desktop.
{ pkgs, system }:
let
nodejs-src = {
"x86_64-linux" = {
url = "https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.gz";
sha256 = pkgs.lib.fakeSha256;
};
"aarch64-linux" = {
url = "https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-arm64.tar.gz";
sha256 = pkgs.lib.fakeSha256;
};
"x86_64-darwin" = {
url = "https://nodejs.org/dist/v16.13.2/node-v16.13.2-darwin-x64.tar.gz";
sha256 = pkgs.lib.fakeSha256;
};
"aarch64-darwin" = {
url =
"https://nodejs.org/dist/v16.13.2/node-v16.13.2-darwin-arm64.tar.gz";
sha256 = "sha256-CdMAAIrVh5LBJiKl6v2xTJMVh7uIcT3032TN9P8hiNE=";
};
}.${system};
nodejs = pkgs.stdenv.mkDerivation {
name = "nodejs";
src = pkgs.fetchurl { inherit (nodejs-src) url sha256; };
installPhase = ''
# mkDerivation handles unpacking the .tar.gz,
# so this "build" just consists of handing off the contents
mkdir -p $out
cp -r ./* $out/
'';
meta = { platforms = pkgs.lib.platforms.all; };
};
in
pkgs.yarn.override { nodejs = nodejs; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment