zsh: Make nix-shell pretty and update ps1
This commit is contained in:
parent
947368779d
commit
032fd38053
7 changed files with 39 additions and 14 deletions
|
@ -3,12 +3,13 @@
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
fzf
|
||||
thefuck
|
||||
zsh-fzf-tab
|
||||
zsh-completions
|
||||
zsh-autosuggestions
|
||||
zsh-syntax-highlighting
|
||||
nix-zsh-completions
|
||||
#thefuck
|
||||
zsh-nix-shell
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
|
@ -23,19 +24,21 @@
|
|||
home.file."${config.xdg.configHome}/zsh/.zshrc" = {
|
||||
text = ''
|
||||
#!/usr/bin/env zsh
|
||||
SYNTAX_FILE="${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
|
||||
SYNTAX_PLUGIN="${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
AUTOSUGGEST_PLUGIN="${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
NIX_SHELL_PLUGIN="${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh"
|
||||
|
||||
# On systems that are not on glibc 2.38, loading fzf-tab will fail. This prevents that.
|
||||
if [ -f "/lib/x86_64-linux-gnu/libc.so.6" ]; then
|
||||
GLIBC_VERSION="$(/lib/x86_64-linux-gnu/libc.so.6 | head -n1 | sed -e 's/.* //g' | rev | cut -c2- | rev)"
|
||||
if [ "$GLIBC_VERSION" = "2.38" ]; then
|
||||
FZF_TAB_FILE="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
|
||||
FZF_TAB_PLUGIN="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
|
||||
fi
|
||||
else
|
||||
FZF_TAB_FILE="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
|
||||
FZF_TAB_PLUGIN="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
|
||||
fi
|
||||
|
||||
AUTOSUGGEST_FILE="${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
'' + (builtins.readFile config/.zshrc);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue