feat: add support for additional nix build options, refactor and documentation - #4
Open
yeoldegrove wants to merge 3 commits into
Open
feat: add support for additional nix build options, refactor and documentation#4yeoldegrove wants to merge 3 commits into
nix build options, refactor and documentation#4yeoldegrove wants to merge 3 commits into
Conversation
Add a generic passthrough mechanism to allow passing additional nix build options through nilla-home commands. This enables remote builders (--builders) and any other nix build options. Changes: - Add extra_nix_build_args field to BuildArgs and SwitchArgs - Add trailing_var_arg support to capture arguments after -- - Add args utility module with functions to extract builder information - Update BuildOpts to accept and pass through extra arguments - Update build and switch commands to use passthrough and log build location - Update help text to document the passthrough mechanism Usage example: nilla home build -- --builders "ssh://remote x86_64-linux" nilla home switch -- --builders "ssh://remote x86_64-linux"
Extract duplicated logic from build and switch commands into a shared common module to improve maintainability and reduce code duplication. Changes: - Create commands/common.rs with shared functions: - get_nilla_nix_path(): Resolve project and get nilla.nix path with entry - format_home_attribute(): Format home attribute path - log_build_operation(): Log build operations with location info - Refactor both command implementations to use shared functions - Reduce code duplication and improve maintainability - Improve code readability and consistency
Add comprehensive README documenting: - Integration with Nilla CLI via external subcommand mechanism - Installation methods (with Nilla, without Flakes, with Flakes) - Usage examples with nix build option passthrough - Command examples for build and switch operations - Specifier format documentation for Home Manager configurations
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 adds support for passing additional
nix buildoptions to enable e.g. remote builders in nilla-home, along with comprehensive code refactoring to improve maintainability and reduce duplication. It also adds an initialREADME.md.Features
Remote Build Support
nix buildoptions via--separator--buildersflagImproved Logging
Code Improvements
Refactoring
commands/common.rsmoduleutil/args.rsmodule with constants and utilities for argument parsingbuildandswitchcommandsTechnical Details
trailing_var_argandallow_hyphen_valuesfor flexible argument passthrough--buildersflag to reduce duplicationBuildOptsto accept and pass through extra arguments tonix buildDocumentation
README.mdwith installation instructionsnilla-clias an external subcommand