Skip to content

fix(nixOS): use relative path resolution so it work in vendor directory too#371

Merged
edouard-lopez merged 1 commit intomasterfrom
fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369
Jun 6, 2025
Merged

fix(nixOS): use relative path resolution so it work in vendor directory too#371
edouard-lopez merged 1 commit intomasterfrom
fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369

Conversation

@edouard-lopez
Copy link
Member

@edouard-lopez edouard-lopez commented May 27, 2025

related:

How to test pre-release?

☠️ Feature can be unstable and break your prompt!

fisher install pure-fish/pure@fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369 # branch name
set --universal pure_enable_foo_feature true

First contribution?

Check the 👍 contributing guide for code and naming conventions.

Specs

Documentation

Usage

Installing this version on NixOS should succeed without error

Acceptance Checks

  • Documentation is up-to-date:
    • Add entry in feature list of README.md ;
    • Add entry in features' overview in docs/ ;
    • Add section in feature list to document
      • Features' flag ;
      • Prompt symbol ;
  • Default are defined in conf.d/pure.fish for:
    • Feature flag ;
    • Symbol ;
  • Tests are passing (I can help you 🤗 ):
  • Customization is available ;
  • Feature is implemented.

@edouard-lopez edouard-lopez force-pushed the fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369 branch from a37b653 to 4ca6ee3 Compare May 27, 2025 05:20
@edouard-lopez edouard-lopez force-pushed the master branch 6 times, most recently from b82f200 to baaf886 Compare May 27, 2025 11:02
@caspervk
Copy link

It doesn't work for me:

source: Error encountered while sourcing file “/run/current-system/sw/share/fish/vendor_conf.d/../functions/_pure_prompt_new_line.fish”:
source: No such file or directory

NixOS is very weird. It's symlinks all the way down.

/run/current-system/sw/share/fish/
├── vendor_completions.d
│   ├── bandwhich.fish -> /nix/store/wcnlfvrvaw2d7dq394k9daqy37krlf50-bandwhich-0.23.1/share/fish/vendor_completions.d/bandwhich.fish
│   ├── bat.fish -> /nix/store/119y38i56azh5iflcwwwkws52h40y60d-bat-0.25.0/share/fish/vendor_completions.d/bat.fish
│   ├── bluetooth.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/bluetooth.fish
│   ├── borg.fish -> /nix/store/4kwmqhh0w7chfs89p1k59r0csvb1y26p-borgbackup-1.4.1/share/fish/vendor_completions.d/borg.fish
│   ├── fd.fish -> /nix/store/3j75iyzm2fyh03m21ix5296h8hd06q8z-fd-10.2.0/share/fish/vendor_completions.d/fd.fish
│   ├── footclient.fish -> /nix/store/zwpxm1rfhgym0sgdkxffbm5y8x1rmg68-foot-1.22.3/share/fish/vendor_completions.d/footclient.fish
│   ├── foot.fish -> /nix/store/zwpxm1rfhgym0sgdkxffbm5y8x1rmg68-foot-1.22.3/share/fish/vendor_completions.d/foot.fish
│   ├── fzf_configure_bindings.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_completions.d/fzf_configure_bindings.fish
│   ├── mpv.fish -> /nix/store/91dv2q4hz4dpa8ki7vfyqy34ix1050jx-mpv-with-scripts-0.40.0/share/fish/vendor_completions.d/mpv.fish
│   ├── nfc.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/nfc.fish
│   ├── nix.fish -> /nix/store/clfkfybsfi0ihp7hjkz4dkgphj7yy0l4-nix-2.28.3/share/fish/vendor_completions.d/nix.fish
│   ├── nixos-container.fish -> /nix/store/csm3q68n81162ykn3wibzh0fs4fm0dhk-nixos-container/share/fish/vendor_completions.d/nixos-container.fish
│   ├── nixos-firewall-tool.fish -> /nix/store/xzfhjkn4am173n6klibs9ikvy1l08hfg-nixos-firewall-tool/share/fish/vendor_completions.d/nixos-firewall-tool.fish
│   ├── podman.fish -> /nix/store/7h4iz9z35w4rkgp9nl8lyv715q9bccaj-podman-5.4.1/share/fish/vendor_completions.d/podman.fish
│   ├── podman-remote.fish -> /nix/store/7h4iz9z35w4rkgp9nl8lyv715q9bccaj-podman-5.4.1/share/fish/vendor_completions.d/podman-remote.fish
│   ├── run-on-ac.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/run-on-ac.fish
│   ├── run-on-bat.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/run-on-bat.fish
│   ├── sway.fish -> /nix/store/v4b76ghvqdiqqah2cw0x95i534cfwylv-sway-1.10.1/share/fish/vendor_completions.d/sway.fish
│   ├── swayidle.fish -> /nix/store/sd64wkxsvjnk033dsr4hjkn12ya0kds0-swayidle-1.8.0/share/fish/vendor_completions.d/swayidle.fish
│   ├── swaylock.fish -> /nix/store/2bnh8qck71sr9hsgdayh0q7hcla5cw5v-swaylock-1.8.2/share/fish/vendor_completions.d/swaylock.fish
│   ├── swaymsg.fish -> /nix/store/v4b76ghvqdiqqah2cw0x95i534cfwylv-sway-1.10.1/share/fish/vendor_completions.d/swaymsg.fish
│   ├── swaynag.fish -> /nix/store/v4b76ghvqdiqqah2cw0x95i534cfwylv-sway-1.10.1/share/fish/vendor_completions.d/swaynag.fish
│   ├── tlp.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/tlp.fish
│   ├── tlp-rdw.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/tlp-rdw.fish
│   ├── tlp-stat.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/tlp-stat.fish
│   ├── wifi.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/wifi.fish
│   ├── wl-copy.fish -> /nix/store/y89kpm6rk0kib5rg8mkwcvhq5h6v2jyi-wl-clipboard-2.2.1/share/fish/vendor_completions.d/wl-copy.fish
│   ├── wl-paste.fish -> /nix/store/y89kpm6rk0kib5rg8mkwcvhq5h6v2jyi-wl-clipboard-2.2.1/share/fish/vendor_completions.d/wl-paste.fish
│   ├── wwan.fish -> /nix/store/ffrvplp4fwcsf9yyw9k5gf755jxhbibh-tlp-1.8.0/share/fish/vendor_completions.d/wwan.fish
│   └── yq.fish -> /nix/store/kflpx5ihql91daz6qmgp6bg477aip48z-yq-go-4.45.4/share/fish/vendor_completions.d/yq.fish
├── vendor_conf.d
│   ├── fzf.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_conf.d/fzf.fish
│   ├── load-fzf-key-bindings.fish -> /nix/store/z3ayhjslz72ldiwrv3mn5n7rs96p2g8a-fzf-0.62.0/share/fish/vendor_conf.d/load-fzf-key-bindings.fish
│   ├── pure.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_conf.d/pure.fish
│   └── _pure_init.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_conf.d/_pure_init.fish
└── vendor_functions.d
    ├── fish_greeting.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/fish_greeting.fish
    ├── fish_mode_prompt.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/fish_mode_prompt.fish
    ├── fish_prompt.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/fish_prompt.fish
    ├── fish_title.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/fish_title.fish
    ├── fzf_configure_bindings.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/fzf_configure_bindings.fish
    ├── _fzf_configure_bindings_help.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_configure_bindings_help.fish
    ├── _fzf_extract_var_info.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_extract_var_info.fish
    ├── fzf_key_bindings.fish -> /nix/store/z3ayhjslz72ldiwrv3mn5n7rs96p2g8a-fzf-0.62.0/share/fish/vendor_functions.d/fzf_key_bindings.fish
    ├── _fzf_preview_changed_file.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_preview_changed_file.fish
    ├── _fzf_preview_file.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_preview_file.fish
    ├── _fzf_report_diff_type.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_report_diff_type.fish
    ├── _fzf_report_file_type.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_report_file_type.fish
    ├── _fzf_search_directory.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_search_directory.fish
    ├── _fzf_search_git_log.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_search_git_log.fish
    ├── _fzf_search_git_status.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_search_git_status.fish
    ├── _fzf_search_history.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_search_history.fish
    ├── _fzf_search_processes.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_search_processes.fish
    ├── _fzf_search_variables.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_search_variables.fish
    ├── _fzf_wrapper.fish -> /nix/store/qcdvb7aajfg83ijxqvy1j05jlcpzf02p-fishplugin-fzf.fish-10.3/share/fish/vendor_functions.d/_fzf_wrapper.fish
    ├── _pure_check_availability.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_check_availability.fish
    ├── _pure_check_for_new_release.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_check_for_new_release.fish
    ├── _pure_detect_container_by_cgroup_method.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_detect_container_by_cgroup_method.fish
    ├── _pure_detect_container_by_pid_method.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_detect_container_by_pid_method.fish
    ├── _pure_format_time.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_format_time.fish
    ├── _pure_get_prompt_symbol.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_get_prompt_symbol.fish
    ├── _pure_is_inside_container.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_is_inside_container.fish
    ├── _pure_is_single_line_prompt.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_is_single_line_prompt.fish
    ├── _pure_k8s_context.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_k8s_context.fish
    ├── _pure_k8s_namespace.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_k8s_namespace.fish
    ├── _pure_parse_directory.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_parse_directory.fish
    ├── _pure_parse_git_branch.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_parse_git_branch.fish
    ├── _pure_place_iterm2_prompt_mark.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_place_iterm2_prompt_mark.fish
    ├── _pure_prefix_root_prompt.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prefix_root_prompt.fish
    ├── _pure_print_prompt.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_print_prompt.fish
    ├── _pure_print_prompt_rows.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_print_prompt_rows.fish
    ├── _pure_prompt_aws_profile.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_aws_profile.fish
    ├── _pure_prompt_beginning.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_beginning.fish
    ├── _pure_prompt_command_duration.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_command_duration.fish
    ├── _pure_prompt_container.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_container.fish
    ├── _pure_prompt_current_folder.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_current_folder.fish
    ├── _pure_prompt_ending.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_ending.fish
    ├── _pure_prompt_first_line.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_first_line.fish
    ├── _pure_prompt.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt.fish
    ├── _pure_prompt_git_branch.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_git_branch.fish
    ├── _pure_prompt_git_dirty.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_git_dirty.fish
    ├── _pure_prompt_git.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_git.fish
    ├── _pure_prompt_git_pending_commits.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_git_pending_commits.fish
    ├── _pure_prompt_git_stash.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_git_stash.fish
    ├── _pure_prompt_jobs.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_jobs.fish
    ├── _pure_prompt_k8s.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_k8s.fish
    ├── _pure_prompt_new_line.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_new_line.fish
    ├── _pure_prompt_nixdevshell.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_nixdevshell.fish
    ├── _pure_prompt_ssh.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_ssh.fish
    ├── _pure_prompt_symbol.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_symbol.fish
    ├── _pure_prompt_system_time.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_system_time.fish
    ├── _pure_prompt_vimode.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_vimode.fish
    ├── _pure_prompt_virtualenv.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_prompt_virtualenv.fish
    ├── _pure_set_color.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_set_color.fish
    ├── _pure_set_default.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_set_default.fish
    ├── _pure_string_width.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_string_width.fish
    └── _pure_user_at_host.fish -> /nix/store/zay9xwzm8nxs9psxhj9yfkgbacw8p99i-fishplugin-pure-4.11.3/share/fish/vendor_functions.d/_pure_user_at_host.fish

4 directories, 95 files

If you want to test yourself, you can create a shell.nix with the following:

{pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
  packages = [
    pkgs.fish
    (pkgs.fishPlugins.buildFishPlugin {
      pname = "pure";
      version = "4.11.2";

      src = pkgs.fetchFromGitHub {
        owner = "pure-fish";
        repo = "pure";
        rev = "4ca6ee33df9bb0a6b1a1800b96acc1cb3a64f324";
        hash = "sha256-UezBDdcd0Ku5wpZLsTXCRnDNejoJKt+JFtpeOcxgWmo=";
      };
    })
  ];
}

And then, with podman or docker:

podman run --rm -it -v ./shell.nix:/shell.nix:ro docker.io/nixos/nix:latest
nix-shell
fish

After pushing a new commit, change the rev to the commit hash -- you will get an error:

error: hash mismatch in fixed-output derivation '/nix/store/4ibwi898n5b1z64jzv5fx7kbkfy04j4f-source.drv':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
            got:    sha256-UezBDdcd0Ku5wpZLsTXCRnDNejoJKt+JFtpeOcxgWmo=
error: Cannot build '/nix/store/q7mijda49lkrglhvv5krl22nbcsgc2sg-fishplugin-pure-4.11.2.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/22blwk6gxgcxnz21zl6zg27gl97qwz47-fishplugin-pure-4.11.2
error: build of '/nix/store/d48yvx47hmfh54jhxfhkmda03d1j3lgb-stdenv-linux.drv', '/nix/store/q7mijda49lkrglhvv5krl22nbcsgc2sg-fishplugin-pure-4.11.2.drv' failed

Change the hash to the got value, and it should work.

There is surely a way to do it all locally, but I'm not sure how -- this way you will mirror exactly how the NixOS package is built.

@edouard-lopez
Copy link
Member Author

Thanks for the detailed message!
I will have to dig deeper on this as I'm not familiar with NixOS ecosystem.

I see there is a $__fish_user_data_dir variable that might be helpful.

I've a docker to test on NixOS that use can use through the make command:

make build-pure-on-nix FISH_VERSION=4.0.2
make test-pure-on-nix FISH_VERSION=4.0.2

@caspervk
Copy link

caspervk commented May 28, 2025

It is not uncommon for programs to be patched as part of the packaging process for NixOS, rather than rely on upstream, since it is so different from other distros. Perhaps the maintainer of the package, @pacien can help.

@edouard-lopez edouard-lopez force-pushed the fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369 branch from 4ca6ee3 to 390570f Compare June 2, 2025 21:44
…ry too

fixes #369
related: fix: source _pure_prompt_new_line event handler instead of relying on autoloading #357
@edouard-lopez edouard-lopez force-pushed the fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369 branch from 390570f to 0649346 Compare June 2, 2025 22:10
@edouard-lopez
Copy link
Member Author

I found a fix using your shell.nix snippet by iterating over $fish_function_path and sourcing the correct file. Could you check it?
N.B.: Don't pay attention to the CI, it's using the latest publish version. If you have a way to automate the build and tests in the pipeline, I'm open to advice, as the current Dockerfile seems clunky.

@edouard-lopez edouard-lopez added the 🐛 bug something that doesn't works as expected label Jun 3, 2025
@caspervk
Copy link

caspervk commented Jun 6, 2025

That seems to work! 🎉

@edouard-lopez edouard-lopez force-pushed the fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369 branch from dba2183 to 0649346 Compare June 6, 2025 20:47
@edouard-lopez edouard-lopez merged commit 19d59fa into master Jun 6, 2025
10 of 12 checks passed
@edouard-lopez edouard-lopez deleted the fix/sourcing-_pure_prompt_new_line-event-handler-nixos-#369 branch June 6, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug something that doesn't works as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: fishPlugins.pure

2 participants