aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs/sass-lint/default.nix
blob: ed87802ac40e207315b62769f1e075701f71588d (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
{ 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 "${name}-${version}" {}
''
  mkdir -p $out/bin
  ln -s ${main}/bin/${name} $out/bin/${name}
  test -x $out/bin/${name}
''