]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - libs.nix
Use sockets for etherpad-lite
[perso/Immae/Config/Nix.git] / libs.nix
index 981039ec2d1b354e43da3fca3d6f9ce349f44f9b..eb00311c987c5d37960d1bad3722cf85871434c2 100644 (file)
--- a/libs.nix
+++ b/libs.nix
@@ -1,5 +1,5 @@
-{ nixpkgs }:
-with nixpkgs;
+{ pkgs }:
+with pkgs;
 rec {
   yarn2nixPackage = let
     src = fetchFromGitHub {
@@ -12,6 +12,8 @@ rec {
   in
     (callPackage src {}) // { inherit src; };
 
+  nodeEnv = import ./lib/node-env.nix;
+
   fetchedGithub = path:
     let
       json = lib.importJSON path;
@@ -57,4 +59,22 @@ rec {
         makeWrapper "$f" "$out" ${toString args}
       '';
 
+  # This adds header colors to the builds, but it rebuilds the whole
+  # world from scratch, so only use it to debug!
+  # add it as postHook in derivations
+  immaePostHook = ''
+    header() {
+      echo -ne "\033[1;36m"
+      echo -n "$1"
+      echo -e "\033[0m"
+    }
+
+    echoCmd() {
+      printf "\033[1;34m%s:\033[0m" "$1"
+      shift
+      printf ' %q' "$@"
+      echo
+    }
+  '';
+
 }