Skip to content

Instantly share code, notes, and snippets.

@pasviegas
Last active June 25, 2020 11:08
Show Gist options
  • Save pasviegas/cd26354ad56d2e2ba1a9b90ce908ae37 to your computer and use it in GitHub Desktop.
Save pasviegas/cd26354ad56d2e2ba1a9b90ce908ae37 to your computer and use it in GitHub Desktop.
with import <nixpkgs> { };
let
formality = stdenv.mkDerivation {
name = "formality";
src = fetchFromGitHub {
owner = "moonad";
repo = "Formality";
rev = "7672090304ec1a5e83a4edb24d02a692620807b6";
sha256 = "1wkixraa21cj05wnibsdb9s7wbs2m3qsq3ssqcjyc4rx0v94szpb";
};
buildInputs = [ nodejs ];
buildPhase = ''
# Install dependencies
cd ./javascript
HOME=. ${pkgs.nodejs}/bin/npm install --force --ignore-scripts --only=production
'';
installPhase = ''
# Copy files
mkdir -p $out/bin
cp -pR ../* $out
# Symlink binaries
ln -s $out/javascript/bin/fm.js $out/bin/fm
ln -s $out/javascript/bin/fmcjs.js $out/bin/fmjs
ln -s $out/javascript/bin/fmcio.js $out/bin/fmio
ln -s $out/javascript/bin/fmcx.js $out/bin/fmx
ln -s $out/javascript/bin/fm2fmc.js $out/bin/fm2fmc
ln -s $out/javascript/bin/fmchs.js $out/bin/fmchs
'';
};
in mkShell { buildInputs = [ formality ]; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment