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

nixos/iso-image: make squashfs compression easily configurable #94660

Merged

Conversation

xaverdh
Copy link
Contributor

@xaverdh xaverdh commented Aug 4, 2020

Motivation for this change

(Re)building the ISO image currently takes ~7min on a modern system, mostly due to squashfs compression of the store.
Using zstd at level 6 instead of xz drops this to ~1 minute (at the cost of a somewhat increased size obviously). This is quite relevant, e.g. if you find yourself repeatedly building iso images with small changes.

While in theory the compression is already configurable in nixos/lib/make-squashfs.nix, iso-image.nix does not pass this option through in a friendly manner. Change this, so people who prefer fast build times over size can just set:
isoImage.squashfsCompression = "zstd -Xcompression-level 6"

This is not my personal motivation, but some people may also choose e.g. zstd for faster decompression.

Things done

Checked that the iso image still builds with these changes as well as with zstdcompression set as hinted above.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

LGTM, but please change the commit message to nixos/iso-image: ...

@xaverdh xaverdh force-pushed the squashfs-configurable-compression branch from 558ff9b to 7f5000c Compare August 4, 2020 19:22
@xaverdh
Copy link
Contributor Author

xaverdh commented Aug 4, 2020

LGTM, but please change the commit message to nixos/iso-image: ...

done

@xaverdh xaverdh changed the title nixos / ISO: make squashfs compression easily configurable nixos/iso-image: make squashfs compression easily configurable Aug 4, 2020
@worldofpeace worldofpeace merged commit c9a3e0a into NixOS:master Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants