Clean up Nix Flake & make it easier to customize #12831
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello. It has been a while since #11528. I am better at Nix, so I decided to take a crack at cleaning the flake up.
My main issues with it is that it was not setup to be very customizable. Also the Cachix cache is nearly useless since it is compiled with
target-cpu=native
, so the cache will nearly always be missed. So I refactored it and added some comments.I did preserve the behavior that the devshell will compile with
target-cpu=native
and other flags. But now the Cachix cache is actually possible to hit.You can see an example of it in use in my NixOS config here: https://github.com/RossSmyth/nixos/blob/f518f62d4c0ce5b4b97bc6b1b8e1a27affc5ed66/home-manager/helix.nix#L10-L18
It should also be relatively straight-forward in the future if anyone wants to add other customization options.
The main issue is that the previous weird setup may be relied one by some people. So this will break them. Also, if customized the overlay will not use the custom build of Helix. I'm not sure if there is a good solution to this.
Commits can be squashed when merged.