volta icon indicating copy to clipboard operation
volta copied to clipboard

[Important feature] Implement single command install with nix / home-manager. Add nix flake

Open izelnakri opened this issue 1 year ago • 0 comments

Hi there,

I see nix as a foundational declarative base for all my system level software. Today some of these good to have software is hosted on npm and can be installed like volta install esyes. However I've already moved most of my system to be reproducible with nix, using Home Manager. I can download/configure all my software using nix with a single command: home-manager switch and rollback if I need to.

Since nix is a programming language, it provides a way to declare functions or overlays that can act as dependency/configuration declarations. It would be GREAT(almost necessary) to expose some Volta nix functions hosted on this repository as a nix flake file(flake.nix) so such dependencies can be declared in any home-configuration.nix . In nix today, one can declare packages in different channels by utilizing overlays, so volta refers to the default channel, and unstable channel can be declared so unstable.volta refers to the unstable channel of nixpkgs while other dependencies can be bind to the default channel.

We need something like this for volta dependencies in nix/home-manager..

Example of nix/home-manager configuration: https://github.com/izelnakri/home-manager/blob/main/users/izelnakri/default.nix#L35

There are tools like this that exist for cargo, npm, however would be great(almost necessary) to map the necessary volta commands to nix as well I think as a flake.nix file.

I'll have a look/solution when I have time, meanwhile I appreciate if you could have a look as well.

izelnakri avatar Feb 26 '24 08:02 izelnakri