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

FLAKE is not a very specific env var #88

Closed
dpc opened this issue Apr 18, 2024 · 11 comments
Closed

FLAKE is not a very specific env var #88

dpc opened this issue Apr 18, 2024 · 11 comments

Comments

@dpc
Copy link

dpc commented Apr 18, 2024

I just watched https://www.youtube.com/watch?v=DnA4xNTrrqY and I like the idea.

FLAKE is a very generic name for an env var and I'd prefer something like NIXOS_CONF_FLAKE or NH_OS_FLAKE (good practice to prefix globals like this with a name of a tool).

@viperML
Copy link
Owner

viperML commented Apr 18, 2024

I've had NH_FLAKE in the back of my mind, but at the same time haven't found any project that also uses FLAKE. Perhaps it is possible to parse both from the environment, with priority to the former

@dpc
Copy link
Author

dpc commented Apr 18, 2024

Definitely possible. I thought about _OS_ if nh was to handle more stuff. I don't know if that's the plan. One might have "NixOS configuration flake" and then some other flakes.

@Adda0
Copy link

Adda0 commented Apr 20, 2024

I agree that something like NH_OS_FLAKE or even NH_NIXOS_FLAKE, and maybe in the future NH_<OTHER>_FLAKE would be a great descriptive and conflict-free solution.

However, if I am not mistaken, one could use nh on non-NixOS system for, for example, managing their home manager configuration flake. So maybe something like NH(_MAIN)_CONFIG_FLAKE or similar to make the name of the env var more general, yet still descriptive?

@viperML
Copy link
Owner

viperML commented Apr 20, 2024

You can use wrapper-manager to wrap nh and not pollute the global environment

@Adda0
Copy link

Adda0 commented Apr 20, 2024

That is a very interesting project indeed. This approach would solve this issue for me.

@x3rAx
Copy link

x3rAx commented Aug 10, 2024

I'd love to see something like NH_OS_FLAKE and NH_HOME_FLAKE used by the commands nh os and nh home respectively, with a fallback to a general NH_FLAKE (or just FLAKE or whatever) when the command specific variable is not set

Or maybe don't use NH_FLAKE at all and simply support FLAKE just for backwards compatibility, since I don't know of a way to have the os/home config in the same flake other using the "home manager in system config" approach. But I guess in that case, you can't build home manager independently fom your system anyways?

@viperML viperML closed this as completed Nov 18, 2024
@Adda0
Copy link

Adda0 commented Nov 18, 2024

Just to get on the same page, may I ask what is the conclusion from this discussion which resulted in closing the issue? What is the recommended approach we should use now?

@viperML
Copy link
Owner

viperML commented Nov 18, 2024

nh will use NH_FLAKE as of 4.0 for any installable

@Adda0
Copy link

Adda0 commented Nov 18, 2024

Wonderful. Thank you very much ❤️

@viperML
Copy link
Owner

viperML commented Nov 18, 2024

For the record, I don't know how I could reuse the same Installable clap Args, and use a different env variable depending on the context.

@viperML
Copy link
Owner

viperML commented Nov 20, 2024

Related: #174

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

No branches or pull requests

4 participants