From what I remember as part of the last time I configured fzf using home-manger(although I mostly cared about the CTR-T/R and default command). I had to log in and out as a user for the changes to take effect).
Well, I am reporting about this very late. I have rebooted my system several times. Isn’t there a way to check the logs or something like that? To see what the real FZF_DEFAULT_OPTS is? I do echo $FZF_DEFAULT_OPTS and nothing shows up.
{ ... }:
{
programs.fzf = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
# Note: Effect to the shell environment variables only took place after reboot.
# rg can be used but fd is the better choice. It is purpose built for listing files,
# which is what you want for fzf. ripgrep can list files too, but that
# isn't its primary function. Its primary function is to search files.
# CTRL-T - $FZF_CTRL_T_COMMAND
fileWidgetCommand = ''fd --type file --type directory --hidden --exclude .git'';
# ALT-C - $FZF_ALT_C_COMMAND
changeDirWidgetCommand = "fd --type directory --hidden --exclude .git";
# Default command that is executed for fzf - $FZF_DEFAULT_COMMAND
defaultCommand = "fd --type file --hidden --exclude .git";
};
}
And saw nothing. I am on 25.11 xantusia. Here’s my config. The modules/user/shell directory has the shell tool configuration. I don’t have any idea how to fix it. But if it’s working for you, then probably it’s my mistake somewhere. Or perhaps there’s something wrong with the colors module of fzf.
One of two the things.
and was able to find the values I set inside of my /nix/store
rg "#403d52" /nix/store
Are you sure your fzf home-manger configuration are being built? here is my fzf config(without the colors) you can look at how it is included in my repository and might get a clue.
Okay. I read the files and stuff. I mean I read the .zshenv created by home-manager and the .zshrc created by home manager.
My .zshenv contains this:
. "/etc/profiles/per-user/krish/etc/profile.d/hm-session-vars.sh"
# Only source this once
if [[ -z "$__HM_ZSH_SESS_VARS_SOURCED" ]]; then
export __HM_ZSH_SESS_VARS_SOURCED=1
fi
export ZDOTDIR=$HOME/.config/zsh
lg()
{
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
lazygit "$@"
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
fi
}
typeset -U path cdpath fpath manpath
for profile in ${(z)NIX_PROFILES}; do
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
done
HELPDIR="/nix/store/4kaqyfdyq0mj70r3q8ms2zyahdz7zggp-zsh-5.9/share/zsh/$ZSH_VERSION/help"
path+="$HOME/.config/zsh/plugins/fzf-tab"
fpath+="$HOME/.config/zsh/plugins/fzf-tab"
autoload -U compinit && compinit
source /nix/store/81s1mpv0x9r9p18xsp68h2083aipkmvq-zsh-autosuggestions-0.7.1/share/zsh-autosuggestions/zsh-autosuggestions.zsh
ZSH_AUTOSUGGEST_STRATEGY=(completion)
if [[ -f "$HOME/.config/zsh/plugins/fzf-tab/fzf-tab.plugin.zsh" ]]; then
source "$HOME/.config/zsh/plugins/fzf-tab/fzf-tab.plugin.zsh"
fi
# History options should be set in .zshrc and after oh-my-zsh sourcing.
# See https://github.com/nix-community/home-manager/issues/177.
HISTSIZE="10000"
SAVEHIST="10000"
HISTFILE="$HOME/.zsh_history"
mkdir -p "$(dirname "$HISTFILE")"
setopt HIST_FCNTL_LOCK
unsetopt APPEND_HISTORY
setopt HIST_IGNORE_DUPS
unsetopt HIST_IGNORE_ALL_DUPS
unsetopt HIST_SAVE_NO_DUPS
unsetopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_SPACE
unsetopt HIST_EXPIRE_DUPS_FIRST
setopt SHARE_HISTORY
unsetopt EXTENDED_HISTORY
if [[ $options[zle] = on ]]; then
source <(/nix/store/z3ayhjslz72ldiwrv3mn5n7rs96p2g8a-fzf-0.62.0/bin/fzf --zsh)
fi
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
if [[ $TERM != "dumb" ]]; then
eval "$(/nix/store/sa6y5dghbdj04i4dwz7lxglfk1iafdci-starship-1.23.0/bin/starship init zsh)"
fi
if test -n "$KITTY_INSTALLATION_DIR"; then
export KITTY_SHELL_INTEGRATION="no-rc"
autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration
kitty-integration
unfunction kitty-integration
fi
alias -- ..='cd ..'
alias -- btop='btop --force-utf'
alias -- cdg='cd $(git rev-parse --show-toplevel)'
alias -- cleanall='sudo nix-collect-garbage -d && nix-collect-garbage -d'
alias -- eza='eza --icons auto --color auto --git --group-directories-first --header'
alias -- ffetch=/nix/store/jwlbs8ifkmdll51mkv3xq0b5cbg83pra-fastfetch-2.45.0/bin/fastfetch
alias -- gocon='cd $HOME/.dotfiles'
alias -- kitcat='/nix/store/xr89vplyhipa0gmxnf08pj2jrlxkw864-kitty-0.42.1/bin/kitten icat'
alias -- la='eza -a'
alias -- ll='eza -l'
alias -- lla='eza -la'
alias -- ls=eza
alias -- lt='eza --tree'
alias -- oldvim=/nix/store/i5323bb72x07y56d8z2iwb589g56k2y8-vim-9.1.1336/bin/vim
alias -- peaclock='/nix/store/ii2q1w8n1dsdzvf9v5vhfjd6g26f2ywp-peaclock-0.4.3/bin/peaclock --config-dir ~/.config/peaclock --config ~/.config/peaclock/config'
alias -- rm='echo "Don'\''t use this, use trash";false'
alias -- update='sudo nixos-rebuild switch'
alias -- yt-music='yt-dlp -x -f bestaudio'
source /nix/store/rjrc4zzpjn9viahdjikggpqa6436jnwq-zsh-syntax-highlighting-0.8.0/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_HIGHLIGHTERS+=()
eval "$(/nix/store/lgq3wvj0rnds3nmisx0x4s622sgj42vg-zoxide-0.9.8/bin/zoxide init zsh --cmd cd)"
Notice that the hm-session-vars.sh does contain the FZF* vars, but still they don’t show up in the printenv command.
Okay something happened after I copied the lines from your original config (the one without the colors). the FZF_DEFAULT_OPTS began to be sourced. I don’t know what’s actually happening here. I also gave a defaultOptions = ; line.
I am using the home-manager as nixos module. After every nixos-rebuild switch, the .nix-profile in the home-directory is a broken symlink. The hm-session-vars are all sourced in the .zshenv, so this is not required. But I do remember on older versions on nixos (24.11 and less), the home-manager session variables were not sourced.