You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow global configuration of toolchain management
#2834
I am trying to run prek on NixOS, not Nix. The default behavior of prek to download toolchains doesn't work on NixOS because of how library linkage works. This isn't specific to prek; using a uv-downloaded Python interpreter just doesn't work.1
There is PREK_UV_SOURCE=none, but this is only for Python and only for the toolchain manager, not the interpreter/compiler. I think the same problem would exist for rustup or juliaup, and you'd have to do the equivalent for pretty much every supported language via environment variables.
The goal is to be able to use prek as an environment manager (which works fine on NixOS) and command runner, since it's straightforward to provide the toolchains via Nix environments.
A naive implementation could cause problems. This becomes complicated if one wants per-hook or per-repo granularity, but the NixOS-specific use case would be global configuration of management. Similarly, if people encounter weird problems with this and request help, it might be annoying. Opting in to this functionality, since it's niche, would be use at your own risk. If you're using NixOS, you're probably already ok with that.
Footnotes
There are Nix projects for generating and running pre-commit configs, but these don't work for adding prek to codebases where one can't require users to install Nix. ↩
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I am trying to run prek on NixOS, not Nix. The default behavior of prek to download toolchains doesn't work on NixOS because of how library linkage works. This isn't specific to prek; using a uv-downloaded Python interpreter just doesn't work.1
According to https://prek.j178.dev/reference/language-support/#toolchain-management-and-language_version, for local hooks one can force the use of a system-installed toolchain. I'd like the ability to on the global (user) level control this functionality so one doesn't need special local hooks.
There is
PREK_UV_SOURCE=none, but this is only for Python and only for the toolchain manager, not the interpreter/compiler. I think the same problem would exist forrustuporjuliaup, and you'd have to do the equivalent for pretty much every supported language via environment variables.The goal is to be able to use prek as an environment manager (which works fine on NixOS) and command runner, since it's straightforward to provide the toolchains via Nix environments.
A naive implementation could cause problems. This becomes complicated if one wants per-hook or per-repo granularity, but the NixOS-specific use case would be global configuration of management. Similarly, if people encounter weird problems with this and request help, it might be annoying. Opting in to this functionality, since it's niche, would be use at your own risk. If you're using NixOS, you're probably already ok with that.
Footnotes
There are Nix projects for generating and running pre-commit configs, but these don't work for adding prek to codebases where one can't require users to install Nix. ↩
All reactions