summary refs log tree commit diff
path: root/nixos/lib/make-squashfs.nix
diff options
context:
space:
mode:
authorDanylo Hlynskyi <abcz2.uprola@gmail.com>2019-01-17 15:24:44 +0200
committerGitHub <noreply@github.com>2019-01-17 15:24:44 +0200
commit23a13b562cb7f1dd8a13aba1863a16aee329019b (patch)
tree6b69894b3a4cfd025074d54a34e96c654f24ed85 /nixos/lib/make-squashfs.nix
parent83963ba209397c424a8ed0660afe063f47fabd83 (diff)
downloadnixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.tar
nixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.tar.gz
nixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.tar.bz2
nixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.tar.lz
nixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.tar.xz
nixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.tar.zst
nixpkgs-23a13b562cb7f1dd8a13aba1863a16aee329019b.zip
kernel config: add support for CONFIG_SQUASHFS_ZSTD (#52967)
Also, allow override `make-squashfs.nix` compression parameters.
Diffstat (limited to 'nixos/lib/make-squashfs.nix')
-rw-r--r--nixos/lib/make-squashfs.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/lib/make-squashfs.nix b/nixos/lib/make-squashfs.nix
index 7ab84e47f53..ee76c9c5bf2 100644
--- a/nixos/lib/make-squashfs.nix
+++ b/nixos/lib/make-squashfs.nix
@@ -3,6 +3,9 @@
 , # The root directory of the squashfs filesystem is filled with the
   # closures of the Nix store paths listed here.
   storeContents ? []
+, # Compression parameters.
+  # For zstd compression you can use "zstd -Xcompression-level 6".
+  comp ? "xz -Xdict-size 100%"
 }:
 
 stdenv.mkDerivation {
@@ -20,6 +23,6 @@ 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 ${comp}
     '';
 }