diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-16 12:49:17 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-16 12:49:17 +0100 |
commit | a556c4b01a536afd90042dad95e7cc09f37d4056 (patch) | |
tree | 7cf071b676e9add3e9f4c736faaa2d66b578583e | |
parent | ea9d3f4ba1cfcab0eeb9cb719fc8065d38c3bb53 (diff) | |
download | Nix-a556c4b01a536afd90042dad95e7cc09f37d4056.tar.gz Nix-a556c4b01a536afd90042dad95e7cc09f37d4056.tar.zst Nix-a556c4b01a536afd90042dad95e7cc09f37d4056.zip |
Add postHook to colorize build outputs
-rw-r--r-- | config/config.nix | 17 | ||||
-rw-r--r-- | default.nix | 14 |
2 files changed, 17 insertions, 14 deletions
diff --git a/config/config.nix b/config/config.nix index 0b57835..d6b4714 100644 --- a/config/config.nix +++ b/config/config.nix | |||
@@ -9,5 +9,22 @@ | |||
9 | pathsToLink = [ "/bin" "/etc" "/include" "/lib" "/libexec" "/share"]; | 9 | pathsToLink = [ "/bin" "/etc" "/include" "/lib" "/libexec" "/share"]; |
10 | extraOutputsToInstall = [ "bin" "man" "doc" "info" ]; | 10 | extraOutputsToInstall = [ "bin" "man" "doc" "info" ]; |
11 | }; | 11 | }; |
12 | # This adds header colors to the builds, but it rebuilds the whole | ||
13 | # world from scratch, so only use it to debug! | ||
14 | # add it as postHook in derivations | ||
15 | immaePostHook = '' | ||
16 | header() { | ||
17 | echo -ne "\033[1;36m" | ||
18 | echo -n "$1" | ||
19 | echo -e "\033[0m" | ||
20 | } | ||
21 | |||
22 | echoCmd() { | ||
23 | printf "\033[1;34m%s:\033[0m" "$1" | ||
24 | shift | ||
25 | printf ' %q' "$@" | ||
26 | echo | ||
27 | } | ||
28 | ''; | ||
12 | }; | 29 | }; |
13 | } | 30 | } |
diff --git a/default.nix b/default.nix index 538ffaa..5e8c4d3 100644 --- a/default.nix +++ b/default.nix | |||
@@ -2,20 +2,6 @@ with import ./libs.nix; | |||
2 | with import <nixpkgs> {}; | 2 | with import <nixpkgs> {}; |
3 | let | 3 | let |
4 | mypkgs = {}; | 4 | mypkgs = {}; |
5 | postHook = '' | ||
6 | header() { | ||
7 | echo -ne "\033[1;36m" | ||
8 | echo -n "$1" | ||
9 | echo -e "\033[0m" | ||
10 | } | ||
11 | |||
12 | echoCmd() { | ||
13 | printf "\033[1;34m%s:\033[0m" "$1" | ||
14 | shift | ||
15 | printf ' %q' "$@" | ||
16 | echo | ||
17 | } | ||
18 | ''; | ||
19 | 5 | ||
20 | mypkgs.ledger = (ledger.override { boost = boost166; }).overrideAttrs (_old: | 6 | mypkgs.ledger = (ledger.override { boost = boost166; }).overrideAttrs (_old: |
21 | fetchedGithub ./fetched/ledger.json // { | 7 | fetchedGithub ./fetched/ledger.json // { |