-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
nixos/system: Support pre-activated images #237040
Conversation
mkdir $out/bin | ||
substituteAll ${./switch-to-configuration.pl} $out/bin/switch-to-configuration | ||
chmod +x $out/bin/switch-to-configuration | ||
${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) '' |
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.
Don't you only need to have perl
available on the hostPlatform
?
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.
(or on host and build?)
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.
@perl@
is substituted in switch-to-configuration.pl
.
substituteAll
obscures that. Would be nice to be explicit about the variables.
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.
Apologies, my comment was about whether you needed to guard on same host platform and build platform to run the Perl check and I was wondering as Perl is like just checking a script if it could run beyond that condition.
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 suppose you could bring a separate perl for that purpose, but I doubt that it'd be worth the effort.
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.
That's fair
This has uncovered some previously broken tests, but works with my fixes applied: Don't know how to fix (but not a blocker): |
Allows omission of this functionality through disabledModules, e.g. for image building.
This helps with understanding the code. We might make this not depend on environment variables later. systemBuilderArgs is a form of global state, which isn't helpful.
53c2f97
to
2e234a6
Compare
This way it will be easier to reuse in a different context, such as a separate build of the activation script by itself (TBD).
These variables were previously used by the activation script build commands, but are now embedded into those commands for to improve reusability for an upcoming addition.
2e234a6
to
772d607
Compare
I wasn't happy about the lack of validation or test, so I did the thing, not just refactor prep anymore. See last commit. |
I am following this PR but my bandwidth is a bit low right now, I will try
to give it a proper review later on.
Le mer. 28 juin 2023 à 14:10, Robert Hensing ***@***.***> a
écrit :
… I wasn't happy about the lack of validation or test, so I did the thing,
not just refactor prep anymore. See last commit.
—
Reply to this email directly, view it on GitHub
<#237040 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACMZRFGC4MIMMMEJMX7AR3XNQNKLANCNFSM6AAAAAAZBWCGJA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
👍 No hurry |
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.
Awesome, this looks good to me. (first read)
I will take it for a walk later on actual systems.
Thanks! |
Description of changes
Mostly refactoring, except for the last commit which introduces the feature.
Things done
sandbox = true
set 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/
)