nix-community / nix-index

Quickly locate nix packages with specific files [maintainers=@bennofs @figsoda @raitobezarius]
Other
817 stars 50 forks source link

nix-index: add option to specify system platform #183

Closed usertam closed 1 year ago

usertam commented 2 years ago

This allows the command nix-index to build indices for foreign system platforms regardless of the host one by using nix-env --argstr system <platform>, which might be useful for multiarch or cross-compile settings.

My own fork of nix-index-database (which builds indices weekly) exploited this to eliminate the need for platform setup/emulations, and by merging this I am hoping to cache the binaries and further reduce the build time of indices. :D

lilyinstarlight commented 2 years ago

I implemented this same thing myself the past few days, intending to PR it, until I saw this (though I kept system as an Option<String>/Option<&str> everywhere instead of checking for emptiness). This looks good though, hopefully it can get merged!

Do you think you'd be able to pull the changes for flake updates from https://github.com/Mic92/nix-index-database to your fork of nix-index-database? That way I'd be able to use it more easily from my config

usertam commented 2 years ago

I implemented this same thing myself the past few days, intending to PR it, until I saw this (though I kept system as an Option<String>/Option<&str> everywhere instead of checking for emptiness). This looks good though, hopefully it can get merged!

Oh definitely I would prefer to use option as well but sadly I don't know rust and this was the best I could come up with. Please leave a review if you don't mind cleaning up my mess :D

Do you think you'd be able to pull the changes for flake updates from https://github.com/Mic92/nix-index-database to your fork of nix-index-database? That way I'd be able to use it more easily from my config

Yes! I added flakes support just now. Actually this was already worked on a while back but I just had to make sure the redesigns don't break things and work as intended. I made some different decisions compared to upstream but now I am (finally) satisfied with them.

lilyinstarlight commented 2 years ago

Yes! I added flakes support just now. Actually this was already worked on a while back but I just had to make sure the redesigns don't break things and work as intended. I made some different decisions compared to upstream but now I am (finally) satisfied with them.

Awesome, thank you!! I just added it to my config. I'll make a review showing how to adjust it for Option<String> in a minute

usertam commented 2 years ago

Thanks so much! I will look over the changes later today :D

Btw your config looks freaking fabulous!! The art on top is just chefs kiss