1

I'm on NixOS-unstable (as of 2023 Oct 1st). How can I configure the text colors for the default NixOS console, as the terminal supports ANSI?

I tested what the colors look like by installing text-ansi on Haskell (GHC) and then putting some code snippets on GHCi, like putStrLn $ red "Hello, world!".

I want to configure the colors because it's slightly hard to visually distinguish between some colors, red and brightRed for example. I'm gonna be annoyed when, for example, playing NetHack. Here's how I want to configure the colors:

  • black = #18270f
  • red = #ff0111
  • green = #2e8011
  • yellow = #b25e3a
  • blue = #0f87fe
  • magenta = #c900ff
  • cyan = #41ff1a
  • white = #eca2ff
  • brightBlack = #000074
  • brightRed = #ff9700
  • brightGreen = #b6ff00
  • brightYellow = #fff86b
  • brightBlue = #00e2ff
  • brightMagenta = #ff0084
  • brightCyan = #00ffa5
  • brightWhite = #e4fffd

(Yes, I know, some colors don't quite fit literally, but believe me, I acquired them from savage computation.)

1 Answer 1

1

You can set them in console.colors, like this:

{
  console.colors = [
    "073642"
    "dc322f"
    "859900"
    "b58900"
    "268bd2"
    "d33682"
    "2aa198"
    "eee8d5"
    "002b36"
    "cb4b16"
    "586e75"
    "657b83"
    "839496"
    "6c71c4"
    "93a1a1"
    "fdf6e3"
  ];
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .