aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs/nodejs-sass/default.nix
blob: 043e7cc35e83bf4b6078c69362c927e6537a8bdd (plain)
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
{ stdenv, pkgs, nodejs, writeScript }:

let

  inherit (builtins)
    attrNames
    fromJSON
    head
    readFile
    ;

  packages = fromJSON (readFile ./main.json);
  package = head packages;

  name = head (attrNames package);
  version = package.${name};

  main = (import ./main.nix {
    inherit pkgs;
    inherit (pkgs) nodejs;
    inherit (stdenv) system;
  })."${name}-${version}";


in
pkgs.runCommand "nodejs-sass-${version}" {}
''
  mkdir -p $out/bin
  ln -s ${main}/lib/node_modules/node-sass/bin/node-sass $out/bin/node-sass
  test -x $out/bin/node-sass
''