node updater improvements
- Make it run from anywhere - overwrite old packages only on success to prevent getting into a bad state
This commit is contained in:
parent
d7a03511b6
commit
33323e4006
@ -1,10 +1,15 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#! nix-shell -I nixpkgs=../../.. -i bash -p nodePackages.node2nix
|
#! nix-shell shell-generate.nix -i bash
|
||||||
# NOTE: Script must be run from the node-packages directory
|
|
||||||
|
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
rm -f node-env.nix
|
cd "$NODE_NIXPKGS_PATH/pkgs/development/node-packages"
|
||||||
node2nix --nodejs-10 -i node-packages-v10.json -o node-packages-v10.nix -c composition-v10.nix
|
rm -f ./node-env.nix
|
||||||
node2nix --nodejs-12 -i node-packages-v12.json -o node-packages-v12.nix -c composition-v12.nix
|
for version in 10 12 13; do
|
||||||
node2nix --nodejs-13 -i node-packages-v13.json -o node-packages-v13.nix -c composition-v13.nix
|
tmpdir=$(mktemp -d)
|
||||||
|
node2nix --nodejs-$version -i node-packages-v$version.json -o $tmpdir/node-packages-v$version.nix -c $tmpdir/composition-v$version.nix
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
mv $tmpdir/node-packages-v$version.nix .
|
||||||
|
mv $tmpdir/composition-v$version.nix .
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd -
|
||||||
|
9
pkgs/development/node-packages/shell-generate.nix
Normal file
9
pkgs/development/node-packages/shell-generate.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ nixpkgs ? import ../../.. {} }:
|
||||||
|
with nixpkgs;
|
||||||
|
mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
bash nodePackages.node2nix
|
||||||
|
];
|
||||||
|
NODE_NIXPKGS_PATH = toString ./.;
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user