mirror of
https://github.com/srid/nixos-config.git
synced 2026-04-10 05:07:28 +08:00
home-manager/direnv: Workaround a lazygit bug
https://github.com/jesseduffield/lazygit/issues/5279
This commit is contained in:
parent
d858b1a3f0
commit
765ba2aae7
1 changed files with 19 additions and 0 deletions
|
|
@ -13,4 +13,23 @@
|
|||
hide_env_diff = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Avoid "warning: unhandled Platform key FamilyDisplayName" which crashes lazygit
|
||||
# See: https://github.com/jesseduffield/lazygit/issues/5279
|
||||
# We use a file in lib/ that sorts alphabetically after hm-nix-direnv.sh
|
||||
# so that we can wrap its functions.
|
||||
xdg.configFile."direnv/lib/zz-macos-fix.sh".text = ''
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# Wrap use_flake
|
||||
if declare -f use_flake >/dev/null; then
|
||||
eval "$(declare -f use_flake | sed 's/^use_flake/original_use_flake/')"
|
||||
use_flake() { original_use_flake "$@"; unset DEVELOPER_DIR; }
|
||||
fi
|
||||
# Wrap use_nix
|
||||
if declare -f use_nix >/dev/null; then
|
||||
eval "$(declare -f use_nix | sed 's/^use_nix/original_use_nix/')"
|
||||
use_nix() { original_use_nix "$@"; unset DEVELOPER_DIR; }
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue