Command flag to force colored output for `nixos-rebuild`
Is your feature request related to a problem? Please describe.
While piping nixos-rebuild to nix-output-monitor the text warning: Git tree '/etc/nixos' is dirty would lose its color
Describe the solution you'd like A command flag or an environment variable to turn colored output on even if the output is piped.
Describe alternatives you've considered None.
Additional context
Priorities
Add :+1: to issues you find important.
https://github.com/NixOS/nix/pull/7650 would fix this
Nope, it would not. This issue should be closed, since it is caused by nom nom'ing the terminal codes that Nix is unconditionally sending, so --color would have no influence.
https://github.com/NixOS/nix/blob/16fa5aa30556ab69d829e81a06d57e0807e69510/src/libutil/logging.cc#L33-L36
Nope, it would not. This issue should be closed, since it is caused by nom nom'ing the terminal codes that Nix is unconditionally sending, so --color would have no influence.
It isn't unconditional, there is a function that filters out the ANSI codes depending on some factors:
https://github.com/NixOS/nix/blob/master/src/libutil/terminal.cc#L10-L84
And that PR should probably fix this, since it touches the code that call filterANSIEscapes.