1#!/usr/bin/env bash
2
3set -eu -o pipefail
4
5cd "$( dirname "${BASH_SOURCE[0]}" )"
6
7node2nix=$(nix-build ../../.. -A nodePackages.node2nix)
8
9rm -f ./node-env.nix
10
11# Track the latest active nodejs LTS here: https://nodejs.org/en/about/releases/
12"${node2nix}/bin/node2nix" \
13 -i node-packages.json \
14 -o node-packages.nix \
15 -c composition.nix \
16 --pkg-name nodejs_22
17
18# using --no-out-link in nix-build argument would cause the
19# gc to run before the script finishes
20# which would cause a failure
21# it's safer to just remove the link after the script finishes
22# see https://github.com/NixOS/nixpkgs/issues/112846 for more details
23rm ./result