-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixosImages: add to pkgs #153551
base: master
Are you sure you want to change the base?
nixosImages: add to pkgs #153551
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,16 @@ with pkgs; | |
|
||
nix-update-script = callPackage ../common-updater/nix-update.nix { }; | ||
|
||
### Push NixOS images into the fixed point | ||
|
||
nixosImages = let | ||
system = stdenv.hostPlatform.system; | ||
release-packages = (import ../../nixos/release.nix) { | ||
supportedSystems = [ stdenv.hostPlatform.system ]; | ||
}; | ||
in lib.mapAttrs (name: value: value.${system}) | ||
{ inherit (release-packages) iso_minimal iso_gnome iso_plasma5 amazonImage; }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These underscores are counter to Nixpkgs conventions. Does it make sense to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think something like |
||
|
||
### Push NixOS tests inside the fixed point | ||
|
||
nixosTests = import ../../nixos/tests/all-tests.nix { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they really inside the fixpoint or dangling from it?
They don't use any other value from it than
system
.pkgsStatic.nixosImages
is wrong; so are the cross sets.Part of the problem of course is the
nixpkgs.nix
module, which is somewhat mandatory because of its existence inmodule-list.nix
; mkForcing_module.args.pkgs
or settingsnixpkgs.pkgs
is counter to traditional NixOS expectations, but probably ok if you useassertions
to make sure nonixpkgs.overlays
ornixpkgs.config
are set.If we insert
pkgs
into the images, which is not a technical problem, we do get a little eval performance improvement, as we evaluatepkgs
once for all images instead of over and over for each.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also conditionally add this if
hostPlatform.system == targetPlatform.system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think restricting is necessary, although it does reduce the changes to
release.nix
to make this work. The conditional attr does make the fixpoint attrset strict instdenv
, so that could slow down exclusive use ofpkgsStatic
for example (if it isn't already slowed down by that), but that can be fixed by supporting cross invocations later.First, what you can do is define a module here that you pass as a new optional argument to
release.nix
, which in turn adds it directly in the list of modules thatmakeModules
returns, and to the othermodules =
params.The module then only has to set
nixpkgs.pkgs
and make sure nonixpkgs.config
is set. Overlays are actually already supported by thenixpkgs.nix
module.