Skip to content

Warning Regarding NixOS Package Configuration and Zoxide Integration in Fish shell #4

Description

@mateowoetam

Warning Regarding NixOS Package Configuration and Zoxide Integration in Fish shell

When running the package on NixOS, particularly with zoxide, there are important considerations for setting up brrtfetch as part of the shellInit so it executes upon terminal startup.

If you initialize zoxide with zoxide init fish without specifying the fish integration correctly, it may not function as intended. Specifically, the command z will not be assigned to zoxide unless the configuration is specified as follows:

fish = {
      interactiveShellInit = ''
        ${lib.getExe pkgs.zoxide} init fish | source
        timeout 3 brrtfetch -width 30 -height 30 -fps 10 /etc/nixos/ascii.gif
      '';
};

Explanation

The issue arises because if the configuration is not specified correctly, NixOS interprets the initialization in a way that results in the config.fish file executing brrtfetch before zoxide. This sequence disrupts zoxide's functionality and disables the z command.

Bad Configuration Example

# Interactive shell initialization
set fish_greeting # Disable greeting
timeout 3 brrtfetch -width 30 -height 30 -fps 10 /etc/nixos/ascii.gif

/nix/store/7lh4ina0b99aql433h56iq3fvp1d8znn-zoxide-0.9.8/bin/zoxide init fish | source

Correct Configuration Example

# Interactive shell initialization
set fish_greeting # Disable greeting
/nix/store/7lh4ina0b99aql433h56iq3fvp1d8znn-zoxide-0.9.8/bin/zoxide init fish | source
timeout 3 brrtfetch -width 30 -height 30 -fps 10 /etc/nixos/ascii.gif

Following this configuration ensures that zoxide initializes properly, allowing you to use the z command as expected.

Comment for Developer

I've encountered a puzzling issue when brrtfetch interacts with the fish shell and zoxide. Specifically, if brrtfetch runs before zoxide is initialized, it appears to disable the z command functionality.

Could you please shed light on why this might happen? Is there a way to fix this interaction to enhance compatibility with the fish shell and zoxide?

Thank you for your attention!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions