diff --git a/home-manager/bash.nix b/home-manager/bash.nix index 5760a723..6941b44f 100644 --- a/home-manager/bash.nix +++ b/home-manager/bash.nix @@ -129,10 +129,6 @@ ${lib.getBin pkgs.coreutils}/bin/stty stop undef source "${homemade-pkgs.posix_shared_functions}" - - if [ 'linux' = "$TERM" ]; then - apply_iceberg - fi '' + builtins.readFile ./initExtra.bash; diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix index fcf9abee..47eedd10 100644 --- a/home-manager/zsh.nix +++ b/home-manager/zsh.nix @@ -209,10 +209,6 @@ source_sh "${homemade-pkgs.posix_shared_functions}" - if [ 'linux' = "$TERM" ]; then - apply_iceberg - fi - # https://superuser.com/a/902508/120469 # https://github.com/zsh-users/zsh-autosuggestions/issues/259 zshaddhistory() { whence ''${''${(z)1}[1]} >| /dev/null || return 1 } diff --git a/nixos/console.nix b/nixos/console.nix index 74a2a9e5..1d97f05c 100644 --- a/nixos/console.nix +++ b/nixos/console.nix @@ -4,6 +4,7 @@ { homemade-pkgs, ... }: { + # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/config/console.nix # https://wiki.archlinux.org/title/Linux_console console = { earlySetup = true; @@ -13,5 +14,59 @@ packages = with homemade-pkgs; [ cozette ]; keyMap = "us"; + + # Applying iceberg for 16(0-15) console colors + # Original schema is shared in https://gist.github.com/cocopon/1d481941907d12db7a0df2f8806cfd41 + # You can test as `echo -en "\e]P484a0c6"` the P4's "4" means blue. It is same as 0 start index 4 in this list + # In hex, 12 will be C as "PC91acd1" for 12 index bright blue. + colors = [ + # 0 - black + "1e2132" + + # 1 - red + "e27878" + + # 2 - green + "b4be82" + + # 3 - yellow + "e2a478" + + # 4 - blue. Should be changed to avoid unreadable ANSI blue. See GH-660 + "84a0c6" + + # 5 - magenta + "a093c7" + + # 6 - cyan + "89b8c2" + + # 7 - white + "c6c8d1" + + # 8 - bright black + "6b7089" + + # 9 - bright red + "e98989" + + # 10 - bright green + "c0ca8e" + + # 11 - bright yellow + "e9b189" + + # 12 - bright blue + "91acd1" + + # 13 -bright magenta + "ada0d3" + + # 14 - bright cyan + "95c4ce" + + # 15 - bright white + "d2d4de" + ]; }; } diff --git a/pkgs/posix_shared_functions/default.nix b/pkgs/posix_shared_functions/default.nix index 4b772ecf..ba8d9a1c 100644 --- a/pkgs/posix_shared_functions/default.nix +++ b/pkgs/posix_shared_functions/default.nix @@ -35,36 +35,4 @@ pkgs.writeText "posix_shared_functions.sh" '' gch() { fc -nrl 1 | ${lib.getExe fzf-bind-posix-shell-history-to-git-commit-message} } - - # See the reason in GH-660 - # Original scheme: https://gist.github.com/cocopon/1d481941907d12db7a0df2f8806cfd41 - apply_iceberg() { - # Blue. Mandatory to be changed from ANSI - echo -en "\e]P484a0c6" - echo -en "\e]PC91acd1" - - # Black - echo -en "\e]P01e2132" - echo -en "\e]P86b7089" - - # Red - echo -en "\e]P1e27878" - echo -en "\e]P9e98989" - - # Green - echo -en "\e]P2b4be82" - echo -en "\e]PAc0ca8e" - - # Yellow - echo -en "\e]P3e2a478" - echo -en "\e]PBe9b189" - - # Magenta - echo -en "\e]P5a093c7" - echo -en "\e]PDada0d3" - - # White - echo -en "\e]P7c6c8d1" - echo -en "\e]PFd2d4de" - } ''