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

programs/nh: allow flake uris to be set #358462

Closed
wants to merge 1 commit into from

Conversation

Shawn8901
Copy link
Contributor

@Shawn8901 Shawn8901 commented Nov 23, 2024

This allows a configuration like

  programs.nh = {
    enable = true;
    flake = "github:shawn8901/nix-configuration";
  };

which lets the user use nh module even when the flake is not available locally (nh itself supports that anyways already).

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 23, 2024
@Shawn8901 Shawn8901 requested a review from viperML November 23, 2024 15:17
@JohnRTitor JohnRTitor self-requested a review November 23, 2024 17:10
default = null;
description = ''
The path that will be used for the `FLAKE` environment variable.
Any type of flake URI or a path that will be used for the `FLAKE` environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should provide an example here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoms config should I add, or build up an crafted dummy? I was also thinking about that as the Auto-Upgrade provides one, but I didn't want to copy the example nor I wanted to artificially promote my own repos. I mean if all a fine with that, I can do so.

Or do we have any other reasonable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnRTitor i rephrased the description to include examples how a flake reference that can be passed looks like. As i wanted to provide an example for both i opted against using the example field. Let me please know if i should fill that with one of the options.

I used crafted dummy paths.

@Shawn8901 Shawn8901 added the backport release-24.11 Backport PR automatically label Nov 23, 2024
@viperML
Copy link
Contributor

viperML commented Nov 23, 2024

@Shawn8901 In any case, NH 4.0 will support any installable (-f, --expr, etc) and I want to support multiple env variables. So we will probably have to rework the module in any case.

@Shawn8901
Copy link
Contributor Author

Honestly i am not sure if i misunderstand the intention of the comment (or am just super salty at the time reading the response). Unless there is a planned release date for that reworked 4.0 version within the next days, wouldn't it be more okayish to just improve the UX on the old state?

But it sounds for me, that we are preferring to wait for some rework in the future.
For me sad, as it kind of just started about arguing about how a flake reference might look like and give examples about it (but those should be hopefully known anyways, when using flakes, as they are used on every ones input attrs).

But i am fine in not doing it and just pick that change to my own fork until there is some rework available.

@Shawn8901 Shawn8901 closed this Nov 23, 2024
@Shawn8901 Shawn8901 deleted the nh_allow_flake_uri branch November 23, 2024 20:59
@viperML
Copy link
Contributor

viperML commented Nov 23, 2024

I already approved the PR, just wanted to add that remark

@JohnRTitor
Copy link
Contributor

For me sad, as it kind of just started about arguing about how a flake reference might look like and give examples about it

I came here to merge this you know. There was no need to close this PR.

@sjdrc
Copy link

sjdrc commented Dec 2, 2024

Ran into this issue just now. Can we re-open this? Or shall I open a new MR?

@JohnRTitor
Copy link
Contributor

JohnRTitor commented Dec 2, 2024

Reopening this isn't possible as the OP deleted their branch, just cherry-pick the commits

@Shawn8901
Copy link
Contributor Author

Ran into this issue just now. Can we re-open this? Or shall I open a new MR?

Feel free to open as a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants