Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Setting Fish/Nushell as Default Shell Breaks Home Manager Modules on macOS #1380

Closed
2 tasks done
phucleeuwu opened this issue Mar 11, 2025 · 15 comments
Closed
2 tasks done

Comments

@phucleeuwu
Copy link

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

Description

I use shell integration for every module. When I set Fish or Nushell as my default shell on macOS, Home Manager modules (such as atuin, eza, fzf, ... ) none of them are work or recognized. However, if I use macOS's default shell (zsh) and then manually start fish or nu, everything works fine.

Image

Steps to Reproduce

  1. Ensure Fish or Nushell is installed via Home Manager.
  2. Add Fish or Nushell to /etc/shells.
  3. Change the default shell:
    chsh -s 
  4. Restart the terminal and open a new session.
  5. Try running commands from installed Home Manager modules (e.g., atuin, eza).

Expected Behavior

Fish or Nushell should correctly recognize commands installed by Home Manager.

Actual Behavior

Commands such as atuin, eza, and fzf are not found, leading to errors like:

fish: Unknown command: atuin
- (line 1):
atuin uuid
^~~~^
...
fish: Unknown command: eza
- (line 1):
function eza --description 'alias eza eza --icons always --color always --git --group-directories-first'; command eza --icons always --color always --git --group-directories-first $argv

Additional Information

  • OS: macOS
  • Shells Affected: Fish, Nushell
  • Works in: Zsh (when launching Fish/Nushell manually)
  • Fails in: Fish/Nushell (when set as the default shell)
  • Nix Setup: Nix-Darwin Flake (Unstable) + Home Manager (Unstable)

Possible Cause

Home Manager environment variables and paths may not be properly initialized when Fish/Nushell is set as the default shell.

Would appreciate any insights on how to fix this issue! Thanks!

Maintainer CC

@trueNAHO @rycee

System information

- system: `"aarch64-darwin"`
 - host os: `Darwin 24.3.0, macOS 15.3.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.24.12`
 - nixpkgs: `/nix/store/xfh1w1c6d3v1b79fwdfnddcbg1pdj674-source`
@emilazy
Copy link
Collaborator

emilazy commented Mar 11, 2025

I don’t think we have Nushell support in nix-darwin, but for fish you need to ensure you have programs.fish.enable turned on in nix-darwin as well as Home Manager.

@phucleeuwu
Copy link
Author

I don’t think we have Nushell support in nix-darwin, but for fish you need to ensure you have programs.fish.enable turned on in nix-darwin as well as Home Manager.

already do that

@bestlem
Copy link

bestlem commented Mar 11, 2025

What is your PATH in non working fish?

@phucleeuwu
Copy link
Author

phucleeuwu commented Mar 11, 2025

What is your PATH in non working fish?

I use home manager as darwin module to config nix this is my fish module config:

{ config, pkgs, ... }:

{
  programes.fish = {
  	enable = true;
  	interactiveShellInit = ''
    	set fish_greeting # Disable greeting
  		'';
	};
}

@emilazy
Copy link
Collaborator

emilazy commented Mar 11, 2025

programes.fish contains a typo, so if you have this file it’s definitely not getting applied as configuration.

@phucleeuwu
Copy link
Author

programes.fish contains a typo, so if you have this file it’s definitely not getting applied as configuration.

this is just the demonstrate, my fish config is apply because It's not show the welcome message

@trueNAHO
Copy link

For reference, this is a cross-post of nix-community/home-manager#6568.

@bestlem
Copy link

bestlem commented Mar 12, 2025

It would help if you answered the questions you have been asked.
e.g. what is your PATH

ALso show us your config. If there is something you want to keep secret then cut out all but the fish setup.

@phucleeuwu
Copy link
Author

phucleeuwu commented Mar 12, 2025

It would help if you answered the questions you have been asked. e.g. what is your PATH

ALso show us your config. If there is something you want to keep secret then cut out all but the fish setup.

Not thing secret here, this It my full config nix darwin and home manager. This is fish home manager module

@bestlem
Copy link

bestlem commented Mar 12, 2025

In your darwin setup where do you set up fish? I think it needs to be programs.fish.enable = true;

My nix knowledge is limited when you atrt importing files so just a guess,
In home/shell/fish.nix yopu have fish.enable = true shouldn't this be programs.fish.enable = true; ?

You can check what the actual values set are by using nix repl

@phucleeuwu
Copy link
Author

In your darwin setup where do you set up fish? I think it needs to be programs.fish.enable = true;

My nix knowledge is limited when you atrt importing files so just a guess, In home/shell/fish.nix yopu have fish.enable = true shouldn't this be programs.fish.enable = true; ?

You can check what the actual values set are by using nix repl

program.fish.enable = true; is correct but I don't need to do that because this script does that for me

@bestlem
Copy link

bestlem commented Mar 12, 2025

Using nix repl on your config gives

nix-repl> darwinConfigurations.phuclees-Mac-mini.config.programs.fish.enable
false

@phucleeuwu
Copy link
Author

phucleeuwu commented Mar 12, 2025

Using nix repl on your config gives

nix-repl> darwinConfigurations.phuclees-Mac-mini.config.programs.fish.enable
false

Of course It's false because I use home manager module for nix darwin. Try this:

Image

@emilazy
Copy link
Collaborator

emilazy commented Mar 12, 2025

That's the Home Manager setting. As I said, you must set it in both nix-darwin and Home Manager.

@phucleeuwu
Copy link
Author

phucleeuwu commented Mar 12, 2025

That's the Home Manager setting. As I said, you must set it in both nix-darwin and Home Manager.

I see. Using programs.fish.enable = true; in both Home Manager and Nix Darwin works. This issue can be closed now. However, I find it annoying that enabling fish only in Home Manager doesn’t work. Why is that?

@Enzime Enzime closed this as completed Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants