git.iko.soy/typeable/nixpkgs
on master help sign in
yarn2nix: remove deprecated yarn2nix fetch script
commit79723fcfb86ec858b9bc70ad8656ccf16b3121ed authorlassulus <lassulus@lassul.us> dateFri 1 Jan 2021, 17:34 (6 years ago) parent23d75e6
2 files changed−50
pkgs/development/tools/yarn2nix-moretea/fetch-source.nix−10 pkgs/development/tools/yarn2nix-moretea/generate.sh−40
pkgs/development/tools/yarn2nix-moretea/fetch-source.nixdeleted−10
@@ -1,10 +0,0 @@
1−{ pkgs ? (import ../../../../. {})
2−, fetchFromGitHub ? pkgs.fetchFromGitHub
3−}:
4−
5−fetchFromGitHub {
6− owner = "moretea";
7− repo = "yarn2nix";
8− rev = "9e7279edde2a4e0f5ec04c53f5cd64440a27a1ae";
9− sha256 = "0zz2lrwn3y3rb8gzaiwxgz02dvy3s552zc70zvfqc0zh5dhydgn7";
10−}
pkgs/development/tools/yarn2nix-moretea/generate.shdeleted−40
@@ -1,40 +0,0 @@
1−#!/usr/bin/env bash
2−
3−###
4−### This script runs 'nix-build' with ./fetch-source.nix and copies a subset
5−### of the resulting store path into the current working directory.
6−###
7−### To disable running chmod, you may set the environment
8−### variable "FIX_RIGHTS" to "no".
9−###
10−
11−set -euo pipefail
12−
13−# 'nix-build' command
14−NIX_BUILD_BIN="${NIX_BUILD_BIN:-"/usr/bin/env nix-build"}"
15−
16−# where to place the yarn2nix source
17−TARGET_DIR="${TARGET_DIR:-"./yarn2nix"}"
18−
19−# whether to run 'chmod -R u=rwX,g=rX,o-rwx' on copied files in $TARGET_DIR
20−FIX_RIGHTS="${FIX_RIGHTS:-"yes"}"
21−
22−fetch_git_source() {
23− [[ -f ./fetch-source.nix ]] && ret="$($NIX_BUILD_BIN --no-out-link ./fetch-source.nix)" && ec="$?" || ec="$?"
24− if [[ "$ec" == "0" ]]; then
25− echo "$ret"
26− else
27− printf "error: failed at 'fetch_git_source()' with '%s'" "$ret"
28− fi
29−}
30−
31−result="$(fetch_git_source)"
32−if [[ "$result" == "/nix/store"* ]]; then
33− mkdir -p "$TARGET_DIR"
34− cp -Rv \
35− "${result}/"{bin,internal,lib,nix,default.nix,package.json,yarn.nix,yarn.lock,LICENSE.txt} \
36− "$TARGET_DIR"
37− [[ "$FIX_RIGHTS" = "yes" ]] \
38− && chmod -v "u=rwX,g=rX,o-rwx" -R \
39− "$TARGET_DIR/"{bin,internal,lib,nix,default.nix,package.json,yarn.nix,yarn.lock,LICENSE.txt}
40−fi