Fish shell plugins missing from profile on one machine but not on another

Hi!

I have the following in my home-manager configuration, which is embedded into a large NixOS configuration used on multiple machines:

{ config, pkgs, lib, ... }:
{
  programs.fish = {
    enable = true;
    shellAbbrs.foo = "bar";
  };

  home.packages = with pkgs.fishPlugins; [
    fzf-fish
    pisces
  ];
};

On the first of my machines (a desktop), this works fine. The foo shell abbreviation, and both plugins are available in fish.

But on a second machine (a server), the shell abbreviations work, but the plugins are not installed.

On both machines, I inspected the contents of /etc/profiles/per-user/myname which is where the plugins should be installed. On the first machine, the plugin functions are installed and working in share/fish/vendor_functions.d (It’s a symlink to a directory in a home-manager-path derivation). But on the second machine, share/fish is missing.

Next, I inspected the .drv files for the profiles on each machine and found the home-manager-path derivations that each one depends on. On both machines, these home-manager-path derivations contain a share/fish/vendor_functions.d directory with the plugins installed, so I don’t think this is a home-manager problem.

For reference, here these are the contents of /etc/profiles/per-user/myname/share on the first machine:

total 176
dr-xr-xr-x  2 root root 4096 Dec 31  1969 accountsservice
dr-xr-xr-x  2 root root 4096 Dec 31  1969 appdata
dr-xr-xr-x  2 root root 4096 Dec 31  1969 applications
dr-xr-xr-x  2 root root 4096 Dec 31  1969 bash-completion
dr-xr-xr-x  2 root root 4096 Dec 31  1969 dbus-1
dr-xr-xr-x  2 root root 4096 Dec 31  1969 desktop-directories
dr-xr-xr-x  2 root root 4096 Dec 31  1969 doc
dr-xr-xr-x  2 root root 4096 Dec 31  1969 emacs
lrwxrwxrwx  1 root root   72 Dec 31  1969 fish -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/fish
lrwxrwxrwx  1 root root   73 Dec 31  1969 fonts -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/fonts
lrwxrwxrwx  1 root root   71 Dec 31  1969 fzf -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/fzf
lrwxrwxrwx  1 root root   75 Dec 31  1969 gettext -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/gettext
lrwxrwxrwx  1 root root   71 Dec 31  1969 git -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/git
lrwxrwxrwx  1 root root   76 Dec 31  1969 git-core -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/git-core
lrwxrwxrwx  1 root root   75 Dec 31  1969 git-gui -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/git-gui
lrwxrwxrwx  1 root root   72 Dec 31  1969 gitk -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/gitk
lrwxrwxrwx  1 root root   74 Dec 31  1969 gitweb -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/gitweb
lrwxrwxrwx  1 root root   79 Dec 31  1969 gnome-shell -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/gnome-shell
lrwxrwxrwx  1 root root   73 Dec 31  1969 gnupg -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/gnupg
dr-xr-xr-x  2 root root 4096 Dec 31  1969 hunspell
dr-xr-xr-x  3 root root 4096 Dec 31  1969 icons
dr-xr-xr-x  2 root root 4096 Dec 31  1969 info
dr-xr-xr-x  2 root root 4096 Dec 31  1969 kservices5
dr-xr-xr-x  2 root root 4096 Dec 31  1969 kservicetypes5
dr-xr-xr-x  2 root root 4096 Dec 31  1969 kxmlgui5
lrwxrwxrwx  1 root root   74 Dec 31  1969 locale -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/locale
dr-xr-xr-x  2 root root 4096 Dec 31  1969 man
dr-xr-xr-x  2 root root 4096 Dec 31  1969 metainfo
dr-xr-xr-x 14 root root 4096 Dec 31  1969 mime
dr-xr-xr-x  2 root root 4096 Dec 31  1969 nano
dr-xr-xr-x  3 root root 4096 Dec 31  1969 nautilus-python
dr-xr-xr-x  2 root root 4096 Dec 31  1969 org
dr-xr-xr-x  2 root root 4096 Dec 31  1969 pixmaps
lrwxrwxrwx  1 root root   77 Dec 31  1969 pkgconfig -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/pkgconfig
dr-xr-xr-x  2 root root 4096 Dec 31  1969 polkit-1
dr-xr-xr-x  2 root root 4096 Dec 31  1969 sounds
dr-xr-xr-x  2 root root 4096 Dec 31  1969 systemd
dr-xr-xr-x  2 root root 4096 Dec 31  1969 terminfo
dr-xr-xr-x  2 root root 4096 Dec 31  1969 themes
dr-xr-xr-x  2 root root 4096 Dec 31  1969 thumbnailers
dr-xr-xr-x  2 root root 4096 Dec 31  1969 vim-plugins
dr-xr-xr-x  2 root root 4096 Dec 31  1969 vulkan
dr-xr-xr-x  2 root root 4096 Dec 31  1969 X11
lrwxrwxrwx  1 root root   71 Dec 31  1969 zsh -> /nix/store/9zj0wmkzdq7d5p3sy9mmmb9amfvx4yam-home-manager-path/share/zsh

And here’s the same, but on the second machine. Note that none of the symlinks to the home-manager-path are present:

total 108
dr-xr-xr-x  2 root root 4096 Dec 31  1969 appdata
dr-xr-xr-x  2 root root 4096 Dec 31  1969 applications
dr-xr-xr-x  2 root root 4096 Dec 31  1969 bash-completion
dr-xr-xr-x  2 root root 4096 Dec 31  1969 dbus-1
dr-xr-xr-x  2 root root 4096 Dec 31  1969 desktop-directories
dr-xr-xr-x  2 root root 4096 Dec 31  1969 doc
dr-xr-xr-x  2 root root 4096 Dec 31  1969 emacs
dr-xr-xr-x  2 root root 4096 Dec 31  1969 hunspell
dr-xr-xr-x  2 root root 4096 Dec 31  1969 icons
dr-xr-xr-x  2 root root 4096 Dec 31  1969 info
dr-xr-xr-x  2 root root 4096 Dec 31  1969 kservices5
dr-xr-xr-x  2 root root 4096 Dec 31  1969 kservicetypes5
dr-xr-xr-x  2 root root 4096 Dec 31  1969 kxmlgui5
dr-xr-xr-x  2 root root 4096 Dec 31  1969 man
dr-xr-xr-x  2 root root 4096 Dec 31  1969 metainfo
dr-xr-xr-x 14 root root 4096 Dec 31  1969 mime
dr-xr-xr-x  2 root root 4096 Dec 31  1969 nano
dr-xr-xr-x  2 root root 4096 Dec 31  1969 org
dr-xr-xr-x  2 root root 4096 Dec 31  1969 pixmaps
dr-xr-xr-x  2 root root 4096 Dec 31  1969 polkit-1
dr-xr-xr-x  2 root root 4096 Dec 31  1969 sounds
dr-xr-xr-x  2 root root 4096 Dec 31  1969 systemd
dr-xr-xr-x  2 root root 4096 Dec 31  1969 terminfo
dr-xr-xr-x  2 root root 4096 Dec 31  1969 themes
dr-xr-xr-x  2 root root 4096 Dec 31  1969 thumbnailers
dr-xr-xr-x  2 root root 4096 Dec 31  1969 vim-plugins
dr-xr-xr-x  2 root root 4096 Dec 31  1969 vulkan

I can’t for the life of me understand why one of these works and other doesn’t. Any insight would be appreciated. I can provide more details if necessary.

This snippet is invalid for several reasons, so I’m really not sure what you’re saying is actually in your config.

  • programs.fish would need to be inside some containing attrset literal, or you could leave off the { config, pkgs, lib, ... }: line and I would assume its location, but as is I’m not quite sure what to do with it. It’s just plain invalid syntax.
  • programs.fish.home.packages is not a valid home-manager option.

Sorry about that! I was trying to write up an abbreviated version of my actual config to just include the parts relevant to my question, but got careless. Shoulda re-read it before hitting ‘submit’. I’ve edited the original question to fix the syntax. It’s what you would expect now.

Are you certain that the home-manager generation is successfully activating? Check systemctl status home-manager-<username>.service, or just set an option whose result you can easily see and check if the result actually takes place.

Yes. systemctl status home-manager-myname.service reports that it activated successfully. And every other aspect of my home-manager configuration, including other options in the same module posted above, like the shell abbreviations, all work and update appropriately when I change them then rebuild.

Ah, I think the issue might be whether you have programs.fish.enable = true; set in the nixos config.

That’s done it, thank you!

I’m not sure why that option was enabled on my desktop but not on my server. A simple text-search didn’t find anything fish-related in the desktop-only parts of my config. Maybe it gets set internally by some other option and I didn’t realize. But that’s a mystery for another time, and not related to this question. Thanks for the help!