Nushell: Nix commands and sudo failure

I want to try nushell in nix. but some things do not work. For instance nix-shell -p xxx does not work

nix-shell -p neovim
error:
       … while calling the 'import' builtin
         at «string»:1:18:
            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (neovim) ]; } ""
             |                  ^

       … while realising the context of a path

       … while calling the 'findFile' builtin
         at «string»:1:25:
            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (neovim) ]; } ""
             |                         ^

       error: executing SQLite statement 'insert or replace into Cache(domain, key, value, timestamp) values ('file', '{"name":"flake-registry.json","store":"/nix/store","url":"https://channels.nixos.org/flake-registry.json"}', '{"etag":"W/\"f284424ae1a4369a3f591f28915f7e43176ccc52bdf7117ff49868055d6c522b\"","storePath":"pc6y12ccrlvmgfbp0rs34cbj8mbsyyvk-flake-registry.json","url":"https://channels.nixos.org/flake-registry.json"}', 1753210872)': attempt to write a readonly database, attempt to write a readonly database (in '/home/papanito/.cache/nix/fetcher-cache-v3.sqlite')

Also running sudo does not work as expected

sudo ls
sudo: /run/current-system/sw/bin/sudo must be owned by uid 0 and have the setuid bit set

Exiting nushell and using zsh, works fine with above commands.

My config is here: dotfiles/private_dot_config/nushell at main · papanito/dotfiles · GitHub