nixpkgs module: Clean up platform options#38485
Conversation
nixos/modules/misc/nixpkgs.nix
Outdated
There was a problem hiding this comment.
This would be a fully elaborated platform, and quite large. I could put something minimal too.
917f0f3 to
f942916
Compare
There was a problem hiding this comment.
Don't need fallback cause I added default one in module.
nixos/modules/misc/nixpkgs.nix
Outdated
There was a problem hiding this comment.
Renaming this breaks nixops.
nixos/lib/eval-config.nix
Outdated
There was a problem hiding this comment.
The ? builtins.currentSystem fallback above is no longer needed. At some future point I'll make this work with an // optionalAttrs (args ? system) { .. } instead.
f942916 to
bfa13a8
Compare
|
I put |
|
N.B. local system was added in https://github.com/NixOS/nixpkgs/pull/22575/files, pre 17.09 I believe. |
|
Oops didn't mean to right that even before @edolstra's comment. |
|
IMHO a |
bfa13a8 to
0debd0b
Compare
|
@edolstra I've removed the deprecation part for a separate PR. This isn't just for cross compilation. If you want to do one of
or many other such things for native builds it is necessary too. I choose |
0debd0b to
17a7eae
Compare
|
@edolstra BTW it would be much conceptually better to make one setting always be the run platform, and make the other optional one the build platform for cross, than what we do here (one is always build, the optional one is run), but I didn't want to break the |
- `localSystem` is added, it strictly supercedes system - `crossSystem`'s description mentions `localSystem` (and vice versa). - No more weird special casing I don't even understand TEMP
17a7eae to
c6f7d43
Compare
Renaming stuff is not at all necessary for doing that. Setting ARM version is already possible by doing
I consider this a bad idea. |
|
OK my bad with the ARM example. But if we had this, would we have needed to implement that in Nix? It's not like we do the same for |
|
Also, concretely, there is more in https://github.com/NixOS/nixpkgs/blob/master/lib/systems/default.nix#L20-L46 here than |
Yes we would because the ARM version affects
Yes we do, actually. If you boot with an old enough processor,
But most people don't have any need to change them from the defaults. The existing interface works just fine for them. |
|
@dezgeg Ok fair point with Say we leave I guess I'll relent and abandon plans to get rid of |
|
It'd be nice if there was a sane way to set localSystem in a NixOS config. My immediate use-case is musl, "surprise!", but at a high-level it's strange to not be able to reasonably set Nixpkgs options from a NixOS configuration. On the subject, at least my needs would be met by a mechanism to specify part of the configuration-- this has advantages when targeting multiple "systems", instead of what I have to do now: either hardcode x86_64-unknown-linux-musl or do something completely terrible like introducing a map of system -> localSystem.config. I'm not sure about other use cases. |
|
Yeah this no longer deprecates anything, and we have until 18.09 to bike-shed the localSystem name / make other improvements. |
|
This is great, thanks! Few quick questions/comments now that I've started using it:
I'm not sure what the best solution for this is, I'm not sure how reasonable it would be to try to plumb localSystem everywhere or what other options there might be. But just thought I'd share/report to get some discussion going :). Thanks! On a slightly related note: it'd be "nice" if there was a good way to invoke NixOS tests and other infrastructure with control over (it'd be great if Borg could --at least when asked-- do some musl testing, for example. Anyway...) |
systemis replaced with the more generallocalSystemcrossSystem's description mentionslocalSystem(and vice versa).Motivation for this change
localSystemis the better name we want to use going forward. It's been around for quite a while, actually.Things done
build-use-sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)