Skip to content

fix: detect host platform in init and clarify remote SSH probe failures#470

Open
RobertDeRose wants to merge 2 commits into
numtide:mainfrom
RobertDeRose:fix/init-host-platform
Open

fix: detect host platform in init and clarify remote SSH probe failures#470
RobertDeRose wants to merge 2 commits into
numtide:mainfrom
RobertDeRose:fix/init-host-platform

Conversation

@RobertDeRose
Copy link
Copy Markdown

Summary

  • detect the current host platform when system-manager init generates system.nix
  • avoid hardcoding x86_64-linux in scaffolds created on non-x86_64-linux hosts
  • clarify remote deploy errors so SSH user/auth/connect problems do not look like nix-store PATH failures

Testing

  • nix develop --accept-flake-config --command cargo test -p system-manager
  • confirmed on an aarch64-linux Lima VM that upstream main generates nixpkgs.hostPlatform = "x86_64-linux";

fixes #469

Copy link
Copy Markdown
Member

@eureka-cpu eureka-cpu left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution and clean individual commits @RobertDeRose 🙂

@eureka-cpu
Copy link
Copy Markdown
Member

eureka-cpu commented Apr 26, 2026

The debian container is failing a bit ambiguously, maybe just needs to be retried. All other checks passed.

@RobertDeRose
Copy link
Copy Markdown
Author

@eureka-cpu No problem. I'll see if I can figure out what about this change fails on Debian

@eureka-cpu
Copy link
Copy Markdown
Member

@eureka-cpu No problem. I'll see if I can figure out what about this change fails on Debian

I just re-ran it and it passes, must've been a network error: https://buildbot.numtide.com/#/builders/3075/builds/8

Comment thread crates/system-manager/src/main.rs Outdated
Comment thread crates/system-manager/src/main.rs Outdated
Comment thread crates/system-manager/src/main.rs Outdated
Comment thread crates/system-manager/src/main.rs Outdated
Comment thread crates/system-manager/src/main.rs Outdated
@RobertDeRose RobertDeRose force-pushed the fix/init-host-platform branch from 1a84a08 to 75c7096 Compare April 28, 2026 02:20
@RobertDeRose
Copy link
Copy Markdown
Author

@jfroche I believe I have addressed all your feedback

Copy link
Copy Markdown
Contributor

@picnoir picnoir left a comment

Choose a reason for hiding this comment

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

Overall, I think this feature makes sense. But I don't think this is the right approach, it is a bit brittle. Instead of search-replacing x86_64-linux, we should use a generic placeholder and override it to inject the arch-os duo.

That being said, chris approved this, let's not drive you mad with a gazillion back and forth. Let's merge that and I'll fix this in a subsequent commit.

Let's remove the useless tests and merge this.

Also, if this is LLM generated, please review the output before submitting it in the future.

Comment thread crates/system-manager/src/main.rs Outdated
Comment thread crates/system-manager/src/main.rs Outdated
Comment thread crates/system-manager/src/main.rs Outdated
@eureka-cpu
Copy link
Copy Markdown
Member

@picnoir i hadn't reviewed the latest commit, I think originally it looked okay and I agree it is a bit brittle but then we also have to consider that the template must also work for nix flake init --template

Comment thread crates/system-manager/src/main.rs Outdated
@RobertDeRose RobertDeRose force-pushed the fix/init-host-platform branch from 75c7096 to 6eb5370 Compare May 11, 2026 14:20
- render the generated system.nix template with the current host architecture instead of always emitting x86_64-linux
@RobertDeRose RobertDeRose force-pushed the fix/init-host-platform branch 2 times, most recently from 58aaa90 to 777a26c Compare May 11, 2026 16:44
- distinguish SSH connection/authentication problems from a successful remote login where nix-store is actually missing
- point users at the equivalent ssh command to verify their target host and options first
@RobertDeRose RobertDeRose force-pushed the fix/init-host-platform branch from 777a26c to 6a7990f Compare May 11, 2026 16:59
@RobertDeRose
Copy link
Copy Markdown
Author

@eureka-cpu I addressed your feedback.
@picnoir this was LLM assisted because I am new to Rust and Nix so I did rely on it to help with the tests and some of the implementation for proper placement. To be honest I did review the generated tests, but I didn't focus on if they actually hit production code which was a mistake and lack of time to ensure they did. I'll be more thorough in the future if I submit another PR.

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

Successfully merging this pull request may close these issues.

system-manager init hardcodes x86_64-linux in generated system.nix

4 participants