]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - libs.nix
Refactor configuration and overlays
[perso/Immae/Config/Nix.git] / libs.nix
index 981039ec2d1b354e43da3fca3d6f9ce349f44f9b..630b139c2c60238ab81e6d6042e00c5be92f7101 100644 (file)
--- a/libs.nix
+++ b/libs.nix
@@ -1,5 +1,5 @@
-{ nixpkgs }:
-with nixpkgs;
+{ pkgs }:
+with pkgs;
 rec {
   yarn2nixPackage = let
     src = fetchFromGitHub {
@@ -57,4 +57,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
+    }
+  '';
+
 }