Running a clean install of NixOS in a vm and am learning my way around. I’ve installed the home-manager module and am attempting to configure fzf but setting defaultOptions isn’t working (fzf is working though). As I’m new to NixOS I’m doing this in configuration.nix. These options work if I place them in .zshrc.
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.me = {
isNormalUser = true;
description = "me";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
# thunderbird
];
};
#### HOME MANAGER ####
home-manager.users.me = { pkgs, ... }: {
home.stateVersion = "24.11";
home.packages = with pkgs; [btop];
programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultOptions = [
"layout=reverse"
"info=inline"
"preview='bat {}'"
"border=rounded"
"margin=1"
"padding=1"
];
};
};
The way you set the default option is wrong, see the example from Home Manager - Option Search shows that you should be setting is options as command line argument:
It does work on my machine, did you restart your desktop environment or reboot? As home manager will only apply the change after you restart you user session.
You should be seeing the FZF_DEFAULT_OPTS environment variable being set, if it is not set then try restart your user session.
Yes, I logout and in after each build. I’ve also tried adding via sessionVariables in home manager and that doesn’t work either. When i echo $FZF_DEFAULT_OPTS nothing returns.
Is all of your config in configuration.nix or do you have a separate home.nix file for home manager? I’m setting everything in configuration.nix as this is a single user system.
Maybe you didn’t enable zsh in your home manager config? Because you will also need that to make home manager manage your shell. If that doesn’t work, try to enable bash.
I had enabled zsh in home manager previously but on rebuild it would fail. I suspect manually editing my .zshrc file with my fzf variables prevented the file from being rewritten during the build process and created a conflict. Manually deleting my .zshrc file and enabling zsh in home manager resolved my issue.