X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=libs.nix;h=eb00311c987c5d37960d1bad3722cf85871434c2;hb=d7d031b69f7dfa958d38e96e5ace4b2db023dade;hp=981039ec2d1b354e43da3fca3d6f9ce349f44f9b;hpb=167b81657d696e91545cedde172e7859643bba06;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/libs.nix b/libs.nix index 981039e..eb00311 100644 --- 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 + } + ''; + }