Inspect NH_{OS_{HOSTNAME,SPECIALISATION},HOME_{CONFIGURATION,SPECIALISATION},DARWIN_HOSTNAME} environmental variables#349
Open
Aehmlo wants to merge 2 commits intonix-community:masterfrom
Open
Conversation
This revision introduces a handful of environmental variables to enable fallbacks similar to the NH_FLAKE environmental variable family: * NH_OS_HOSTNAME, * NH_OS_SPECIALISATION, * NH_HOME_CONFIGURATION, * NH_HOME_SPECIALISATION, and * NH_DARWIN_HOSTNAME.
Since there's no way to distinguish between "the user provided a home configuration with --configuration" from "the user provided a home configuration using NH_HOME_CONFIGURATION," this revision updates debug log wording appropriately.
midischwarz12
approved these changes
Aug 10, 2025
NotAShelf
requested changes
Aug 16, 2025
Member
NotAShelf
left a comment
There was a problem hiding this comment.
I'm a little unsure if this is the most elegant solution here, but the change is small enough that I'll let it go. If you could address my comments, I can merge this.
Comment on lines
+246
to
+249
| debug!( | ||
| "Using explicit configuration from flag/environment: {}", | ||
| config_name | ||
| ); |
Member
There was a problem hiding this comment.
Suggested change
| debug!( | |
| "Using explicit configuration from flag/environment: {}", | |
| config_name | |
| ); | |
| debug!( | |
| "Using explicit configuration from flag/environment: {config_name}", | |
| ); |
If I'm not mistaken clippy will tell you this is the correct way. Could also be applied with sh fix.sh in the repository root.
Comment on lines
+19
to
+21
| - The `NH_OS_HOSTNAME`, `NH_OS_SPECIALISATION`, `NH_HOME_CONFIGURATION`, | ||
| `NH_HOME_SPECIALISATION`, and `NH_DARWIN_HOSTNAME` environmental variables are | ||
| now consulted when determining what attribute/specialisation to use. |
Member
There was a problem hiding this comment.
I think we need to be a bit more explicit than "now consulted". Please try to specify the priority and the motive of this change for the potential readers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR uses
clap'senvattribute to specify fallback sources for specifying home configurations, NixOS/Darwin hostnames, and home/NixOS specialisations for situations where the default heuristics are insufficient.Closes #348.