Open diktomat opened 1 year ago
I'll look into this when I get a chance, but I notably cannot reproduce this with the same configuration you have set up:
$ echo $fish_function_path
/Users/winter/.config/fish/functions /nix/store/zdndayx0blswvg332xx3bi2c03gwmcdc-fish-3.6.0/etc/fish/functions /Users/winter/.local/share/fish/vendor_functions.d /Users/winter/.nix-profile/share/fish/vendor_functions.d /run/current-system/sw/share/fish/vendor_functions.d /nix/var/nix/profiles/default/share/fish/vendor_functions.d /Users/winter/.nix-profile/etc/fish/functions /run/current-system/sw/etc/fish/functions /nix/var/nix/profiles/default/etc/fish/functions /Users/winter/.nix-profile/share/fish/vendor_functions.d /run/current-system/sw/share/fish/vendor_functions.d /nix/var/nix/profiles/default/share/fish/vendor_functions.d /nix/store/zdndayx0blswvg332xx3bi2c03gwmcdc-fish-3.6.0/share/fish/vendor_functions.d /nix/store/zdndayx0blswvg332xx3bi2c03gwmcdc-fish-3.6.0/share/fish/functions
Given this, I feel like there's more to the issue, though I don't know what 🤔
Ah, okay, let's try something:
Can you edit your nix-darwin configuration to contain this:
programs.fish = {
enable = true;
useBabelfish = true;
babelfishPackage = pkgs.babelfish;
};
And see if the issue still persists?
And see if the issue still persists?
Works with babelfish added.
Cool, please use that as a "workaround" (IMO it's better anyways). I'll see to looking into why/when this regressed. Thank you for the report!
I'll do, thank you very much! (If you'd like to elaborate, why is this better? I never had the need for using posix scripts from inside fish before, so never researched foreign-env and babelfish..)
babelfish translates the Bash scripts ahead-of-time as opposed to fenv doing it every time it needs to interpret a script. So... speed!
Describe the bug
/etc/fish/nixos-env-preinit.fish
uses a temporary$fish_function_path
, as "This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently unset." (comment in file). However, it is actually run after$__fish_datadir/config.fish
(=/nix/store/jv695hxb7dvn971mxjrfxzmf6sppsvgs-fish-3.6.0/share/fish/config.fish
), so it leaves an empty function path behind, leading to errors on startup.Steps To Reproduce
Steps to reproduce the behavior:
programs.fish.enable = true;
in home-manager and nix-darwin configs.fish --help
(or any other fish cmd, including just starting it) errors not finding functions.echo $fish_function_path
inside fish is empty.Expected behavior
/etc/fish/nixos-env-preinit.fish
should be run before$__fish_datadir/config.fish
, as it's preinit.Additional context
Complete flake: https://gist.github.com/d12bb/f4ac5936eb4ab0184f2eb3e1fbe6973c
Notify maintainers
@cole-h @winterqt @rapenne-s
Metadata