-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
44 lines (35 loc) · 1.07 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
let
pkgs-default =
let fetched = builtins.fetchGit {
url = "https://github.com/NixOS/nixpkgs";
rev = "7e89775a9e618fd494558b2e78f510e9e4ec6b27";
};
in import fetched {};
in { pkgs ? pkgs-default }: let
npmlock2nix =
let fetched = builtins.fetchGit {
url = "https://github.com/tweag/npmlock2nix.git";
rev = "5c4f247688fc91d665df65f71c81e0726621aaa8";
};
in import fetched { inherit pkgs; };
gitignoreSource =
let fetched = builtins.fetchGit {
url = "https://github.com/hercules-ci/gitignore.nix";
rev = "80463148cd97eebacf80ba68cf0043598f0d7438";
};
in (import fetched { inherit (pkgs) lib; }).gitignoreSource;
node_modules = npmlock2nix.node_modules { src = gitignoreSource ./.; };
deriv = pkgs.stdenv.mkDerivation {
name = "ps-inline-asm";
src = ./src;
installPhase = ''
mkdir $out
cp -r ${node_modules}/node_modules $out
cp -r $src/. $out
'';
};
script = pkgs.writeScriptBin "ps-inline-asm" ''
#!${pkgs.bash}/bin/bash
${pkgs.nodejs}/bin/node ${deriv}/main.js "$@"
'';
in script