Synthetica9 / nix-linter

Linter for the Nix expression language
BSD 3-Clause "New" or "Revised" License
158 stars 16 forks source link

Don't allow ./. #32

Open domenkozar opened 4 years ago

domenkozar commented 4 years ago

Using ./. is really big pain for development as it will take parent directory name for derivation name, resulting into impurity and different hashes for anything that depends on it.

The alternative is builtins.path { src = ./.; name = "mypkg" } so it's a bit harder to detect if it's used wrongly.

I think it should be disallowed by Nix itself, but until then linter can do that.

jappeace commented 4 years ago

I think you meant builtins.path { path = ./.; name = "mypkg" } (note the path instead of src). I encountered this while cleaning up my own expressions.