aboutsummaryrefslogtreecommitdiff
path: root/pkgs/nodejs-sass/default.nix
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2018-12-11 18:10:48 +0300
committerIgor Pashev <pashev.igor@gmail.com>2018-12-11 18:10:48 +0300
commit8b0968b2054d3bb8d90b5ac056727f7c2ebeaed3 (patch)
treed03b70f693463fc836a8dbe4240424d2547530c8 /pkgs/nodejs-sass/default.nix
parentc4273035cf5876e3ba8ed2c6b492d31c2de290ee (diff)
downloadnixsap-8b0968b2054d3bb8d90b5ac056727f7c2ebeaed3.tar.gz
(* HUGE *) Use nixpkgs overlays
Diffstat (limited to 'pkgs/nodejs-sass/default.nix')
-rw-r--r--pkgs/nodejs-sass/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/nodejs-sass/default.nix b/pkgs/nodejs-sass/default.nix
new file mode 100644
index 0000000..67e230b
--- /dev/null
+++ b/pkgs/nodejs-sass/default.nix
@@ -0,0 +1,37 @@
+{ pkgs }:
+
+let
+
+ inherit (builtins)
+ attrNames fromJSON head readFile ;
+
+ packages = fromJSON (readFile ./main.json);
+ package = head packages;
+
+ name = head (attrNames package);
+ version = package.${name};
+
+ main =
+ let m = (import ./main.nix {
+ inherit pkgs;
+ inherit (pkgs) nodejs;
+ inherit (pkgs.stdenv) system;
+ });
+ in m // {
+ "${name}-${version}" = m."${name}-${version}".override (super: {
+ # XXX: build bundled libsassl, DO NOT DOWNLOAD binaries!
+ preRebuild = ''
+ SASS_FORCE_BUILD=true npm run-script build
+ '';
+ });
+ };
+
+
+in
+pkgs.runCommand "nodejs-sass-${version}" {}
+''
+ mkdir -p $out/bin
+ ln -s ${main."${name}-${version}"}/lib/node_modules/node-sass/bin/node-sass \
+ $out/bin/node-sass
+ test -x $out/bin/node-sass
+''