mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
netlify-cli: Prepare shrinkwrap-based node2nix package set
This commit is contained in:
parent
5c339ff41e
commit
71429f817d
13
pkgs/development/web/netlify-cli/default.nix
Normal file
13
pkgs/development/web/netlify-cli/default.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ pkgs, lib, fetchFromGitHub }:
|
||||
let
|
||||
nodePackages = import ./composition.nix { inherit pkgs; };
|
||||
in
|
||||
nodePackages.package.override {
|
||||
preRebuild = ''
|
||||
export ESBUILD_BINARY_PATH="${pkgs.esbuild_netlify}/bin/esbuild"
|
||||
'';
|
||||
src = fetchFromGitHub (builtins.fromJSON (builtins.readFile ./netlify-cli.json));
|
||||
bypassCache = true;
|
||||
reconstructLock = true;
|
||||
meta.maintainers = with lib.maintainers; [ roberth ];
|
||||
}
|
14
pkgs/development/web/netlify-cli/generate.sh
Executable file
14
pkgs/development/web/netlify-cli/generate.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu -o pipefail
|
||||
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
||||
rm -f ./node-env.nix
|
||||
src="$(nix-build --expr '(import ../../../.. {}).fetchFromGitHub (builtins.fromJSON (builtins.readFile ./netlify-cli.json))')"
|
||||
echo $src
|
||||
node2nix \
|
||||
--input $src/package.json \
|
||||
--lock $src/npm-shrinkwrap.json \
|
||||
--output node-packages.nix \
|
||||
--composition composition.nix \
|
||||
--node-env node-env.nix \
|
||||
--nodejs-14 \
|
||||
;
|
7
pkgs/development/web/netlify-cli/shell.nix
Normal file
7
pkgs/development/web/netlify-cli/shell.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs ? import ../../../.. {} }:
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
pkgs.nodePackages.node2nix
|
||||
pkgs.nix-prefetch-github
|
||||
];
|
||||
}
|
11
pkgs/development/web/netlify-cli/update.sh
Executable file
11
pkgs/development/web/netlify-cli/update.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash
|
||||
set -euo pipefail
|
||||
mv netlify-cli.json{,.old}
|
||||
nix-prefetch-github-latest-release netlify cli >netlify-cli.json
|
||||
|
||||
if ! diff -U3 netlify-cli.json{.old,}; then
|
||||
echo New version detected\; generating expressions...
|
||||
./generate.sh
|
||||
fi
|
||||
rm -f netlify-cli.json.old
|
Loading…
Reference in New Issue
Block a user