-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
make-disk-image: use nix path-info to automatically set the imageSize #465
base: master
Are you sure you want to change the base?
Conversation
d2d1915
to
91f1f59
Compare
rootPaths = [ systemToInstall.config.system.build.toplevel ]; | ||
}}/registration | ||
|
||
${lib.concatMapStringsSep "\n" (disk: "truncate -s $(($(set -x; nix path-info --json ${systemToInstall.config.system.build.toplevel} | jq .[].closureSize) + ${toString disk.imageSizeExtraBytes})) ${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)} |
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.
newlines could help to make that more readable. and probably using '' instead of "
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 would also assign variables so that in the event of a failure it's easier to spot which part failed.
This seems like a nice QoL improvement. Could you rebase it and address the comments? |
@iFreilicht I don't have the time at the moment, but maybe you or @Enzime could |
I tried to come up with a more accurate algorithm, but it seems impossible. So I am not so sure if we should have this. |
What's the risk? Having the image size reduced automatically seems quite neat, even if it isn't perfect. I see two potential issues:
I don't know too much about how these disk images are used in practice, so I can't tell how bad these are and how big of a pain this PR solves. What do you think? |
This may not be the best approach, but it is an approach.