It seems to me that many of your issues here stem from misaligned expectations.
For example, nix search
is a tool mainly meant for searching a package in a flake. It is a bit unfortunate that nix search regex
cannot just search Nixpkgs when that is what a majority of uses will want but that is a trade off that was chosen to make the command consistent with all other new nix
subcommands. That is IMO a clear improvement over implicit Nixpkgs-specificity of nix-env
. Just running nix search --help
would show you a proper usage: nix search nixpkgs sshfs
That page is a SEO farm or something. If you follow the link to the actual issue, you will find that it has been resolved by Unpin the version of Nix used as a checkInput by mtoohey31 · Pull Request #93 · nix-community/rnix-lsp · GitHub. A similar fix would work for you.
Ideally, Nix would be able to produce an error message that would display the location info like when a non-existent attribute is used but that is not currently possible. While it has improved since 2020, error messages are still one of Nix’s weakest points.
You make a correct inference that your Nixpkgs revision is too old and update it but rather than trying to guess a package name, you should again try to use a package search, as you do next. You just need to notice that the package name is just nix
(or nixVersions.nix_2_9
for the specific minor version). If you click ▾▾▾ Show more package details ▾▾▾, it will even tell you the configuration snippet.
Here you can see how the errors improved compared to the last time
See the other thread for my suggestion.
That means the xs
argument to map
(and thus also forEach
) is string
where it should be a list. Without seeing the trace, it is really impossible to tell where the error occurs.
There was an attempt at bringing a proper type system to Nix that might have helped improve the error messages for wrong argument types but it fizzled out. The focus is now on Nickel so it will probably be a while until we see its fruit in Nixpkgs.
The one you want for darwin
is overrideScope'
, which is not even on that list. There is a proposal to unify the overriding function for derivations so at least that part should get simpler eventually.
It’s not supposed to be but once you slightly wander off the beaten track, it often is. Especially on lower tier platforms like MacOS. Once you need to override anything or use some functions, you are faced with a weird functional language and often not well documented Nixpkgs internals.
People are trying to improve it (e.g. Flakes) but you are still best of having access to someone who can navigate the maze, if you want to have a relatively painless journey. Nix community is very helpful but questions still get lost in the stream.