-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Nix builds for the full registry (#619)
- Loading branch information
1 parent
21f0186
commit 466146b
Showing
14 changed files
with
2,494 additions
and
994 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,3 @@ result | |
|
||
# Keep it secret, keep it safe. | ||
.env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
stdenv, | ||
purix, | ||
slimlock, | ||
purs-backend-es, | ||
esbuild, | ||
writeText, | ||
compilers, | ||
nodejs, | ||
}: let | ||
package-lock = slimlock.buildPackageLock {src = ../.; omit = ["dev" "peer"];}; | ||
spago-lock = purix.buildSpagoLock { | ||
src = ../.; | ||
corefn = true; | ||
}; | ||
|
||
# Since both the importer and the server share the same build process, we | ||
# don't need to build them twice separately and can share an optimized output | ||
# directory. | ||
shared = stdenv.mkDerivation { | ||
name = "registry-app-shared"; | ||
src = ./src; | ||
phases = ["buildPhase" "installPhase"]; | ||
nativeBuildInputs = [purs-backend-es]; | ||
buildPhase = '' | ||
ln -s ${package-lock}/js/node_modules . | ||
cp -r ${spago-lock.registry-app}/output . | ||
echo "Optimizing with purs-backend-es..." | ||
purs-backend-es build | ||
''; | ||
installPhase = '' | ||
mkdir $out | ||
mv output-es $out/output | ||
''; | ||
}; | ||
in { | ||
server = stdenv.mkDerivation rec { | ||
name = "registry-server"; | ||
src = ./src; | ||
nativeBuildInputs = [esbuild]; | ||
buildInputs = [compilers nodejs]; | ||
entrypoint = writeText "entrypoint.js" '' | ||
import { main } from "./output/Registry.App.Server"; | ||
main(); | ||
''; | ||
buildPhase = '' | ||
ln -s ${package-lock}/js/node_modules . | ||
cp -r ${shared}/output . | ||
cp ${entrypoint} entrypoint.js | ||
esbuild entrypoint.js --bundle --outfile=${name}.js --platform=node | ||
''; | ||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp ${name}.js $out/${name}.js | ||
echo '#!/usr/bin/env sh' > $out/bin/${name} | ||
echo 'exec ${nodejs}/bin/node '"$out/${name}.js"' "$@"' >> $out/bin/${name} | ||
chmod +x $out/bin/${name} | ||
cp ${name}.js $out | ||
''; | ||
}; | ||
|
||
github-importer = stdenv.mkDerivation rec { | ||
name = "registry-github-importer"; | ||
src = ./src; | ||
nativeBuildInputs = [esbuild]; | ||
buildInputs = [compilers nodejs]; | ||
entrypoint = writeText "entrypoint.js" '' | ||
import { main } from "./output/Registry.App.Main"; | ||
main(); | ||
''; | ||
buildPhase = '' | ||
ln -s ${package-lock}/js/node_modules . | ||
cp -r ${shared}/output . | ||
cp ${entrypoint} entrypoint.js | ||
esbuild entrypoint.js --bundle --outfile=${name}.js --platform=node | ||
''; | ||
checkPhase = '' | ||
''; | ||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp ${name}.js $out/${name}.js | ||
echo '#!/usr/bin/env sh' > $out/bin/${name} | ||
echo 'exec node '"$out/${name}.js"' "$@"' >> $out/bin/${name} | ||
chmod +x $out/bin/${name} | ||
cp ${name}.js $out | ||
''; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ main = launchAff_ $ do | |
|
||
-- Git env | ||
debouncer <- Git.newDebouncer | ||
|
||
let | ||
gitEnv :: GitEnv | ||
gitEnv = | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.