nur-packages/pkgs/by-name/be/betanin/client/generate.sh

30 lines
544 B
Bash
Raw Permalink Normal View History

2023-09-27 13:58:41 +10:00
#!/usr/bin/env bash
# Requires node2nix and jq
cd "$(dirname "$0")" || exit 1
set -euo pipefail
nix build ..#betanin.src 2>/dev/null
tempDir=$(mktemp -d)
cp result/betanin_client/package.json "$tempDir/"
cp result/betanin_client/package-lock.json "$tempDir/"
pushd "$tempDir"
node2nix \
--input package.json \
--lock package-lock.json \
--output packages.nix \
--composition composition.nix \
--strip-optional-dependencies \
--development \
--nodejs-18
popd
cp "$tempDir"/*.nix .
rm result
rm -rf "$tempDir"