Fail to set overlay shell to users.defaultUserShell

nix version: nixos-23.05

I customize my system configuration with flake, and also customize the fish shell in overlay, here are the details: fish overlay
And I want to set it as default shell in system configuration: link
users.defaultUserShell = pkgs.mypkg.myfish;
And built it with cmd: nixos-rebuild switch --flake .#max, but it raises error nix/store/w72q6h874lngyl8av8ii7kn60npr1g6y-fish is not a shell package

So how should I fix this issue?


It seems as if the result of wrapFish does not provide the passthru.shellPath attribute, which would be required to use a package as a login shell.

As a workaround the following should work:

(wrapFish { … }).overrideAttrs (_: {
  passthru.shellPath = "/bin/fish";
1 Like

I tried this, and now my system is successfully built, thanks.