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
pass "exclude" args to mksquashfs for storage-deficient devices #42795
Conversation
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.
While I never used this, it seems to be pretty useful. It's also nice how this can be done with just a flag to mksquashfs
. Other than my suggested change I'm in favor of adding this.
@@ -20,6 +20,7 @@ stdenv.mkDerivation { | |||
|
|||
# Generate the squashfs image. | |||
mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $out \ | |||
-keep-as-directory -all-root -b 1048576 -comp xz -Xdict-size 100% | |||
-keep-as-directory -all-root -b 1048576 -comp xz -Xdict-size 100% \ | |||
-wildcards ${stdenv.lib.concatStringsSep " " (map (f: "-e '${f}' ") excludeWildcards)} |
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.
There's lib.escapeShellArg
you can use to handle escaping properly.
Ping? |
All of these cases should be fixed by using multiple outputs. I would imagine most of the packages in the default install already do that, do you have any specific list of packages which need this treatment? |
I'm adding another hack to
|
Are there any updates on this pull request, please? |
I'd say, this is pretty niche usecase. My PR https://github.com/NixOS/nixpkgs/pull/52967/files is merged, so workaround using I regret now I've named the argument so narrow-scoped... It should have been called |
Motivation for this change
This is debatable and I do not claim that the current behaviour is wrong. But: when building NixWRT images for storage-starved systems (one of my routers has 4MB flash) it is convenient to be able to say, for example, "exclude lib*.a and man pages" without having to hack every derivation that currently installs them.
Maybe it's generally useful, maybe it's a bit niche. If the latter, would you accept a more general patch to add any options at all to the
mksquashfs
call?Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)