Skip to content
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

iso: copy input closourse into iso to avoide re-download #191

Merged
merged 4 commits into from Mar 16, 2021

Conversation

blaggacao
Copy link
Contributor

@blaggacao blaggacao commented Mar 16, 2021

closes #190

Tested on my setup, considerably cuts times and only leaves one (noticable) download.

library functions now can access inputs (and their sources!)
directly, for example in order to copy their closure into
the iso registry so that evaluating the flake does not need
to fetch inputs again
@blaggacao blaggacao force-pushed the da/impl-190 branch 3 times, most recently from 73507a1 to b32e451 Compare March 16, 2021 21:52
@blaggacao

This comment has been minimized.

This intends to avoid downloading inputs on the iso live image
and is a step towards completely air-gaped installs.

credits: @Pacman99

closes: divnix#190
This avoids for the live nixos on the iso to rebuild the devshell
upon entering it.
@blaggacao blaggacao marked this pull request as ready for review March 16, 2021 23:03
@blaggacao blaggacao requested a review from Pacman99 March 16, 2021 23:04
@blaggacao
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Mar 16, 2021
@Pacman99
Copy link
Member

ohh wait I actually haven't tested that code locally, I just wrote the code out. But it should be simple enough to build the isoConfig and inspect the result.

@blaggacao blaggacao mentioned this pull request Mar 16, 2021
@blaggacao
Copy link
Contributor Author

blaggacao commented Mar 16, 2021

ohh wait I actually haven't tested that code locally, I just wrote the code out. But it should be simple enough to build the isoConfig and inspect the result.

I fully tried end to end and it works.

nix registry list shows all those local store paths.

Maybe we need to filter out the ones that are flake = false, though? or handle them differently? What do you think?

@Pacman99
Copy link
Member

Yeah you could, but it really wouldn't make much of a difference. Worst case theres just one unnecessary folder in the nix store.

@blaggacao
Copy link
Contributor Author

Yeah you could, but it really wouldn't make much of a difference. Worst case theres just one unnecessary folder in the nix store.

Ok, let's don't bother then. That path might even be useful on the iso under some odd circumstances.

@Pacman99
Copy link
Member

So I'm not sure about this. But perhaps we could not import all modules of the system and just selectively pass along parts of the configuration. This would prevent starting up unnecessary system services while still adding necessary dependencies.

I think this would involve evaluating the modules in a seperate nixosSystem call. And just passing along some things.

for example:

environment = { inherit (system.config.environment) systemPackages; };

@blaggacao
Copy link
Contributor Author

So I'm not sure about this. But perhaps we could not import all modules of the system and just selectively pass along parts of the configuration. This would prevent starting up unnecessary system services while still adding necessary dependencies.

Do you refer to your previous suggestion to not enable all modules?

This PR is meant (and restrained to) specifically to target #190. I'll open an issue for that.

@Pacman99
Copy link
Member

Yeah its just another idea. Doesn't have to be a part of this PR.

@blaggacao
Copy link
Contributor Author

x-ref: #194

@blaggacao blaggacao requested a review from nrdxp March 16, 2021 23:30
@bors
Copy link
Contributor

bors bot commented Mar 16, 2021

try

Build succeeded:

@nrdxp
Copy link
Collaborator

nrdxp commented Mar 16, 2021

if it's ready, go ahead and merge
bors delegate+

@bors
Copy link
Contributor

bors bot commented Mar 16, 2021

✌️ blaggacao can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

Copy link
Collaborator

@nrdxp nrdxp left a comment

Choose a reason for hiding this comment

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

LGTM

@blaggacao
Copy link
Contributor Author

blaggacao commented Mar 16, 2021

I suspect that it actually does not cache evaluations, since the commands still take some time in silence, that is no command output (which I only can explain with evaluation)?

Can those evaluations, like this, for example, also be copied into the store?

Let's make this a separate issue, for now, on slow machines it still amounts to some 60 seconds or so.

@blaggacao
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 16, 2021

Build succeeded:

@bors bors bot merged commit e6f15ae into divnix:core Mar 16, 2021
@blaggacao blaggacao deleted the da/impl-190 branch March 16, 2021 23:54
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.

pin inputs into iso live registry
3 participants