Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement nh profile #51

Open
viperML opened this issue Dec 12, 2023 · 4 comments
Open

Implement nh profile #51

viperML opened this issue Dec 12, 2023 · 4 comments

Comments

@viperML
Copy link
Owner

viperML commented Dec 12, 2023

nix profile is so bad, potentially could be nh pkg instead?

@iFreilicht
Copy link

Would you be interested in contributions regarding this? I agree that nix profile is awful and have tried to improve that, but the nix team is focussed on the core right now, so contributions take forever to be reviewed and little progress has been made. Every now and then there is debate about dropping nix profile entirely, so it's about time that an alternative emerged.

I've been thinking about re-writing nix profile fully as an external tool. It wouldn't even share the nix-env logic regarding symlinks and rollbacks with nix itself, as that has flaws as well, see NixOS/nix#311

Ideally, I would like to be able to provide a seamless transition between the imperative interface of install, remove, upgrade and the declarative interface of just editing a Nix file.

The two options would be:

  • Add export and import commands to allow storing the profile as a flake or old-school nix file
  • Make the "manifest" a fully valid Nix file itself, all imperative commands would just parse, edit and re-create that file

Please let me know you thoughts.

@viperML
Copy link
Owner Author

viperML commented Apr 15, 2024

Hey! Thank you very much for the interest!

I have to admit that this issue was in the bottom of my mental stack. As always, one thing leads to another, and I wanted to finish other projects before looking into this.

I also saw that some of the fixes (- I believe around nix 2.20) that are good enough for what I wanted to do with activation-manager, so I also thought nix profile could be good enough.

I'd gladly accept contributions. (Be advised that nh's codebase is a bit rough around the edges). Adding subcommands is just adding a new enum variant to interface.rs, and implementing NHRunnable https://github.com/viperML/nh/blob/master/src/interface.rs#L54-L68 . The subcommands are quite "standalone" from nh as a whole.

But is there any reason you would want to implement this in nh, instead of writing your own standalone CLI tool?

@iFreilicht
Copy link

iFreilicht commented Apr 16, 2024

My main motivation was discoverability. The ecosystem is very fractured because many tiny tools exist for different purposes, and it takes a long time to find all the useful ones that really make the user journey pleasant.

It seems to me like the idea of nh is to incorporate multiple of those into one interface. Though I guess if that is the case, there would be no harm in me making this separately and integrating it here once it's actually mature enough.

Activation-manager looks like a very cool solution as well, though, I'll check it out!

@viperML
Copy link
Owner Author

viperML commented Apr 16, 2024

Though I guess if that is the case, there would be no harm in me making this separately and integrating it here once it's actually mature enough

Feel free to iterate here in nh then! Since your other comment, I've been thinking about that idea of having a mechanism to bridge the imperative world (nix profile etc), and editing declarative files, and sounds like the way to go.

Activation-manager looks like a very cool solution as well, though, I'll check it out!

Most of what I want for AM is still on my head though, the actual code in the repo doesn't reflect that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants