Repository navigation
nixos-generate-config: Add nixpkgs.hostPlatform to hardware-configuration.nix - #177672
lovesegfault merged 6 commits into
Conversation
There was a problem hiding this comment.
I think it's more correct to set localSystem?
There was a problem hiding this comment.
Hm, you have a point, but localSystem isn't correct either, when crossSystem is set.
So the thing is, we can't really specify the host system with a single option.
What we want to set is the "host" system.
| Variable | Meaning when straight | Meaning when cross |
|---|---|---|
| system | host | build |
| localSystem | host | build |
| crossSystem | null | host |
So there's no variable for host.
Damn, for a minute I thought this change was going to be simple.
There was a problem hiding this comment.
I'd be fine with nixos-generate-config assuming you're not cross-compiling. It can also add a comment to the gen'd code saying "If you're cross-compiling, make sure to set crossSystem", or something like that.
There was a problem hiding this comment.
Ok, I've added new options.
| Variable | Meaning when straight | Meaning when cross |
|---|---|---|
| hostSystem | host | host |
| buildSystem | build (=host) | build |
| LEGACY system | host | build |
| LEGACY localSystem | host | build |
| LEGACY crossSystem | null | host |
There was a problem hiding this comment.
Didn't get your message before my previous comment somehow.
I'd be fine with
nixos-generate-configassuming you're not cross-compiling. It can also add a comment to the gen'd code saying "If you're cross-compiling, make sure to set crossSystem", or something like that.
The existing options are too complicated and less meaningful than the general / Nixpkgs terminology. We ought to fix that.
I appreciate that you try to reduce scope creep, but in this case doing half the work results in the generation of half-assed config state that resides on user machines. hardware-configuration.nix should either be a legacy one without any nixpkgs.* options, or one with nixpkgs.hostPlatform. Supporting a third variation would be painful.
There was a problem hiding this comment.
Do you mean to change this line after everything else?
There was a problem hiding this comment.
I appreciate that you try to reduce scope creep, but in this case doing half the work results in the generation of half-assed config state that resides on user machines. hardware-configuration.nix should either be a legacy one without any nixpkgs.* options, or one with nixpkgs.hostPlatform. Supporting a third variation would be painful.
I was mostly trying to unblock you, without asking you to do a bunch of extra work :)
The existing options are too complicated and less meaningful than the general / Nixpkgs terminology. We ought to fix that.
I agree, excited about the changes you made!
d170afe to
dad484a
Compare
dad484a to
69ff12a
Compare
69ff12a to
0f68d14
Compare
|
@ofborg test installer |
lovesegfault
left a comment
There was a problem hiding this comment.
This looks good, a couple of questions:
- Shouldn't
localSystemget deprecated too? - Add a
lib.warnto the deprecated items? - Add something to the release notes?
Kind of. It's bunched in with the other "legacy" options in the assertion the enforces the mutual exclusion of the old and new options.
Not yet. The new options need to exist for some time to make it feasible for the ecosystem to start a migration. For now it's only a preview for flakes users and "typical" NixOS users. Deployment tools like NixOps and the numerous other ones can only switch when the new options are supported in all releases. Adding warnings will only upset people.
Ah yes, of course. Done. The manual does not need changes yet, because the old way is fully supported. Changes can be made if and when it is decided later that this becomes the blessed way. |
|
Sounds good, thanks for this! |
3714d76 to
1b4f4dd
Compare
The substr solution assumed a newline to be present. The new solution will not remove the newline if it goes missing in the future. Apparently this is idiomatic perl. Thanks pennae for the suggestion!
|
@ofborg test installer |
|
What? I ran those tests on ofborg! I guess I'll fix them. |
|
This should help with the channel blocker, although ofborg is broken and I can't run the tests locally. |
Description of changes
Resolves #177664
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes