chisui / zsh-nix-shell

zsh plugin that lets you use zsh in nix-shell shells.
BSD 3-Clause "New" or "Revised" License
384 stars 19 forks source link

nix-shell:9: key: attempt to set associative array to scalar #37

Closed Robotix-00 closed 1 year ago

Robotix-00 commented 1 year ago

When running nix-shell in zsh, I am greeted by the aboth mentioned error nix-shell:9: key: attempt to set associative array to scalar. This doesn't appear to happen when prefixing the nix-shell call with "command". I am using the newest versions of zsh-nix-shell (v0.7.0) and zsh (5.9). Is there a fix other than putting "command" in front of every nix-shell call?

Technical details

  1. command nix-shell -p nix-info --run "nix-info -m"

    • system: "x86_64-linux"
    • host os: Linux 6.3.2, NixOS, 23.05 (Stoat), 23.05.20230517.e6e3899
    • multi-user?: yes
    • sandbox: yes
    • version: nix-env (Nix) 2.15.0
    • channels(root): "nixos"
    • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
  2. zsh --version zsh 5.9 (x86_64-pc-linux-gnu)

Robotix-00 commented 1 year ago

I had the set option "ksharrays" in my zshrc which causes arrays to start at index 0 instead of the default 1. Unsetting this option and everything works flawless.