Errors upgrading/installing packages on non-nix OS

I’m new to nix and set it up on arch linux (x86_64) using the install script. I installed a few packages with nix-env -i [package], and they worked okay, and upgraded with nix-env -u, and now I’m getting the following error when I try to install anything, or upgrade any packages. Does anyone have any idea what’s going on or how I can fix this?

error: attribute 'unsafeDiscardStringContext' missing, at /nix/store/cidxddbcasdgy24rway554q92jfz6hfn-nixpkgs-21.05pre280338.619953ead47/nixpkgs/lib/strings.nix:429:13 (use '--show-trace' to show detailed location information)

Full output at error: while evaluating anonymous function at /nix/store/cidxddbcasdgy24rway554q -

Edit: I also get the error when I query packages with niv-env -qaP [package]. I did nix-env --rollback a few times and the error disappears, but if I nix-env -u to update it comes back.

Edit 2: Also, while working, nix-env -q shows “nix-2.3.10”, and when I run nix-env -u and it no longer works, that package changes to “nix-2.3.10-x86_64-unknown-linux-musl”.

Edit 3: It seems I’m experiencing this: `nix-env --upgrade` upgrades 'nix-2.3.10' to 'nix-2.3.10-x86_64-unknown-linux-musl' · Issue #118481 · NixOS/nixpkgs · GitHub
So just to make sure I understand, I need a third party package to update the package manager? I can’t update it with the update command?

Fixed: `nix-env --upgrade` upgrades 'nix-2.3.10' to 'nix-2.3.10-x86_64-unknown-linux-musl' · Issue #118481 · NixOS/nixpkgs · GitHub