haslersn / any-nix-shell

fish and zsh support for the nix run and nix-shell environments of the Nix package manager
MIT License
253 stars 17 forks source link

Error when setting up ZSH #2

Closed AlexeyRaga closed 1 year ago

AlexeyRaga commented 5 years ago

This fails on mac

$ any-nix-shell --info-right | source /dev/stdin
ERROR: wrong usage
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
gpevnev commented 4 years ago

Use GNU sed and everything should work fine: nix-env -iA nixpkgs.gnused

haslersn commented 4 years ago

Use GNU sed and everything should work fine: nix-env -iA nixpkgs.gnused

Would this be fixed by replacing -r by -E?

haslersn commented 1 year ago

This issue is solved after #22 when you package with

{
  buildInputs = with pkgs; [ bash gnused ];
  installPhase = with pkgs; ''
    mkdir -p $out/bin
    cp -r bin $out
    wrapProgram $out/bin/any-nix-shell --prefix PATH : $out/bin:${lib.makeBinPath buildInputs}
  '';
}

The next downstream (i.e., nixpkgs) package update will contain this fix.