Make terminfo descriptions from Home Manager-installed packages (e.g. kitty, alacritty) discoverable on macOS by exporting TERMINFO_DIRS via hm-session-vars.sh. macOS has no systemd/environment.d equivalent, so the shell session file is the available entry point. Closes nix-community/home-manager#2918 for macOS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
812 B
Nix
27 lines
812 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (config.home) profileDirectory;
|
|
in
|
|
{
|
|
# macOS has no systemd/environment.d equivalent, so expose Home Manager's
|
|
# terminfo via the shell session file sourced by bash/zsh.
|
|
config = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
|
# Not using `home.sessionSearchVariables` because it only prepends, whereas
|
|
# we need `/usr/share/terminfo` appended as an explicit fallback: once
|
|
# TERMINFO_DIRS is set, ncurses stops searching the default system path.
|
|
home.sessionVariables = {
|
|
TERMINFO_DIRS = lib.mkDefault "${profileDirectory}/share/terminfo:$TERMINFO_DIRS\${TERMINFO_DIRS:+:}/usr/share/terminfo";
|
|
};
|
|
|
|
home.sessionVariablesExtra = ''
|
|
# reset TERM with new TERMINFO available (if any)
|
|
export TERM="$TERM"
|
|
'';
|
|
};
|
|
}
|