nixpkgs/pkgs/servers/mx-puppet-discord/generate.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
873 B
Bash
Raw Normal View History

2021-04-15 06:04:24 +02:00
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
tag="v0.1.1"
u="https://gitlab.com/mx-puppet/discord/mx-puppet-discord/-/raw/$tag"
# Download package.json and patch in @discordjs/opus optional dependency
curl $u/package.json |
sed 's|"typescript": *"\^\?3\.[^"]*"|"typescript": "^4.8.3"|' | # TODO: remove when newer typescript version pinned
sed 's|\("dependencies": *{\)|\1\n"@discordjs/opus": "^0.8.0",|' >package.json
2021-04-15 06:04:24 +02:00
node2nix \
--nodejs-14 \
2021-04-15 06:04:24 +02:00
--node-env ../../development/node-packages/node-env.nix \
--input package.json \
--strip-optional-dependencies \
2021-04-15 06:04:24 +02:00
--output node-packages.nix \
--composition node-composition.nix \
--registry https://registry.npmjs.org \
--registry https://gitlab.com/api/v4/packages/npm \
--registry-scope '@mx-puppet'
2021-04-15 06:04:24 +02:00
sed -i 's|<nixpkgs>|../../..|' node-composition.nix
rm -f package.json