Skip to content

Commit

Permalink
nix build
Browse files Browse the repository at this point in the history
breaks pino for some reason
  • Loading branch information
ryjm committed Mar 24, 2022
1 parent 83e06b5 commit 84e211a
Show file tree
Hide file tree
Showing 6 changed files with 1,300 additions and 437 deletions.
51 changes: 51 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib
, nixosTests
, stdenv
, fetchFromGitHub
, makeWrapper
, nodejs
, pkgs
}:

stdenv.mkDerivation rec {
pname = "hoon-language-server";
version = "1.1.0";

nativeBuildInputs = [
nodejs
makeWrapper
];
src = ./.;
buildPhase =
let
nodeDependencies = ((import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
}).nodeDependencies.override (old: {
# access to path '/nix/store/...-source' is forbidden in restricted mode
src = ./.;
dontNpmInstall = true;
}));
in
''
runHook preBuild
ln -s ${nodeDependencies}/lib/node_modules .
export PATH="${nodeDependencies}/bin:$PATH"
npm run build
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/share
cp -a . $out/share/hoon-language-server
makeWrapper ${nodejs}/bin/node $out/bin/hoon-language-server \
--add-flags $out/share/hoon-language-server/out/index.js
runHook postInstall
'';
}
17 changes: 17 additions & 0 deletions node-composition.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:

let
nodeEnv = import ./node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
Loading

0 comments on commit 84e211a

Please sign in to comment.