Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

Commit0c16c75

Browse files
quinn-doughertycristianoc
authored andcommitted
flake init (herc)
1 parentcd10ad3 commit0c16c75

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ dist/gentype-*.tgz
2121
dist/LICENSE
2222
dist/package.json
2323
examples/typescript-react-example/.eslintcache
24+
result

‎flake.lock‎

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎flake.nix‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
description="genType herc CI";
3+
4+
inputs={
5+
nixpkgs.url="nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs={self,nixpkgs}:
9+
let
10+
system="x86_64-linux";
11+
pkgs=importnixpkgs{
12+
system=system;
13+
overlays=[];
14+
};
15+
gentype-source=pkgs.mkYarnPackage{
16+
name="gentype_source";
17+
src=./.;
18+
packageJSON=./package.json;
19+
yarnLock=./yarn.lock;
20+
pkgConfig={
21+
rescript={
22+
buildInputs=withpkgs;[whichgcc_multi];
23+
postInstall=''
24+
echo "PATCHELF'ING RESCRIPT EXECUTABLES (INCL NINJA)"
25+
# Patching interpreter for linux/*.exe's
26+
THE_LD=$(patchelf --print-interpreter $(which mkdir))
27+
patchelf --set-interpreter $THE_LD linux/*.exe && echo "- patched interpreter for linux/*.exe's"
28+
29+
# Replacing needed shared library for linux/ninja.exe
30+
THE_SO=$(find /nix/store/*/lib64 -name libstdc++.so.6 | head -n 1)
31+
patchelf --replace-needed libstdc++.so.6 $THE_SO linux/ninja.exe && echo "- replaced needed for linux/ninja.exe"
32+
'';
33+
};
34+
};
35+
};
36+
gentype=pkgs.stdenv.mkDerivation{
37+
name="gentype";
38+
src=gentype-source+"/libexec/gentype/deps/gentype";
39+
buildInputs=withpkgs;[ocamldune_2];
40+
buildPhase="dune build";
41+
installPhase=''
42+
mkdir -p $out
43+
cp -r _build/default/src/GenType.exe $out
44+
'';
45+
};
46+
in{
47+
48+
packages."${system}"={
49+
gentype=gentype;
50+
};
51+
defaultPackage."${system}"=self.packages."${system}".gentype;
52+
};
53+
}

‎nixos.sh‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# This script is only relevant if you're rolling nixos.
3+
4+
# Esy (a bisect_ppx dependency/build tool) is borked on nixos without using an FHS shell. https://github.com/esy/esy/issues/858
5+
# We need to patchelf rescript executables. https://github.com/NixOS/nixpkgs/issues/107375
6+
set -x
7+
8+
fhsShellName="gentype-development"
9+
fhsShellDotNix="{pkgs ? import <nixpkgs> {} }: (pkgs.buildFHSUserEnv { name =\"${fhsShellName}\"; targetPkgs = pkgs: [pkgs.yarn]; runScript =\"yarn\"; }).env"
10+
nix-shell -<<<"$fhsShellDotNix"
11+
12+
# theLd=$(patchelf --print-interpreter $(which mkdir))
13+
# patchelf --set-interpreter $theLd ./node_modules/gentype/gentype.exe
14+
# patchelf --set-interpreter $theLd ./node_modules/rescript/linux/*.exe
15+
# patchelf --set-interpreter $theLd ./node_modules/bisect_ppx/ppx
16+
# # patchelf --set-interpreter $theLd ./node_modules/bisect_ppx/bisect-ppx-report
17+
# theSo=$(find /nix/store/*$fhsShellName*/lib64 -name libstdc++.so.6 | head -n 1)
18+
# patchelf --replace-needed libstdc++.so.6 $theSo ./node_modules/rescript/linux/ninja.exe

‎yarn.lock‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
debug@^4.1.0:
6+
version "4.3.4"
7+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
8+
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
9+
dependencies:
10+
ms "2.1.2"
11+
12+
ms@2.1.2:
13+
version "2.1.2"
14+
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
15+
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
16+
17+
reanalyze@^1.6.0:
18+
version "1.16.0"
19+
resolved "https://registry.yarnpkg.com/reanalyze/-/reanalyze-1.16.0.tgz#e0935acb797d75e62d7b4f5dceffc6fdd52e1950"
20+
integrity sha512-U8fbzKxKrQCcE9pFcrBQ4E1/n+3TlTaga8CQS7Qcys6zyhDLYXCbdGp5V7g+UcM2AI+xEusnPogUIwpnyNiVPQ==
21+
22+
rescript@^9.1.1:
23+
version "9.1.4"
24+
resolved "https://registry.yarnpkg.com/rescript/-/rescript-9.1.4.tgz#1eb126f98d6c16942c0bf0df67c050198e580515"
25+
integrity sha512-aXANK4IqecJzdnDpJUsU6pxMViCR5ogAxzuqS0mOr8TloMnzAjJFu63fjD6LCkWrKAhlMkFFzQvVQYaAaVkFXw==

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp