Darwin, home-manager, zsh, fzf and zsh-fzf-tab

Hi, beginner phoning in here.

I’ve setup nix, darwin and home-manager on a MacOS VM to test this out. Ive used home-manager to enable zsh and fzf. It seems to work fine, Ctrl+R starts the fzf file widget as expected.

fzf = {
  enable = true;
  enableZshIntegration = true;

zsh = {
  enable = true;
  enableCompletion = true;
  enableAutosuggestions = true;
  syntaxHighlighting.enable = true;

I’m also adding zsh-forgit, zsh-fzf-history-search and zsh-tab via home.packages

home.packages = with pkgs; [ 

These packages are installed into the nix/store, but the zsh integration for these tools is not setup it seems.

Is there some way to see what home-manager is trying to to when I run switch, and if it fails on something is it reported in some log?


I assume OP has figured this out already, but for others looking around, one way to achieve this is to source the plugins manually, taking fzf-tab plugin as an example:

programs.zsh.initExtra = ''
    source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh

The right path to source can be figured out by looking the derivation’s source code, usually in the installPhase we see where are the artifacts copied to.


OP had not. Thank you for taking your time to do this.

I had not realised that installing was not sufficient; that I had to put in the zsh configuration myself, but it makes sense now that you explained it.

Again, thanks.

no worries, let me also mention that alternatively it’s possible to use programs.zsh.plugins as in the examples in the option documentation Appendix A. Configuration Options so we don’t need to source the plugin “manually”, something like:

programs.zsh.plugins = [
        name = "fzf-tab";
        src = pkgs.fetchFromGitHub {
          owner = "Aloxaf";
          repo = "fzf-tab";
          rev = "c2b4aa5ad2532cca91f23908ac7f00efb7ff09c9";
          sha256 = "1b4pksrc573aklk71dn2zikiymsvq19bgvamrdffpf7azpq6kxl2";

this works because in the root of that repo there’s a fzf-tab.plugin.zsh file, otherwise we would need to also use the file attribute to specify the file name that should be sourced instead.