From d8b28c364c861944ddc729ec2242f8827d236ce8 Mon Sep 17 00:00:00 2001 From: Ryan Barry Date: Mon, 1 Apr 2024 22:31:54 -0700 Subject: [PATCH 1/3] zstd is way faster than xz --- os/lib/make-squashfs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/lib/make-squashfs.nix b/os/lib/make-squashfs.nix index 16b0f528a..74cba09dd 100644 --- a/os/lib/make-squashfs.nix +++ b/os/lib/make-squashfs.nix @@ -24,6 +24,6 @@ stdenv.mkDerivation { # Generate the squashfs image. mksquashfs nix-path-registration $(cat $closureInfo/store-paths) \ ${lib.optionalString (secretsDir != null) secretsDir} \ - $out -keep-as-directory -all-root -b 1048576 -comp xz -Xdict-size 100% + $out -keep-as-directory -all-root -b 1048576 -comp zstd -Xcompression-level 3 ''; } From 2c418f9a9bb139ca3059d8629d3c0abee522b575 Mon Sep 17 00:00:00 2001 From: Ryan Barry Date: Mon, 1 Apr 2024 23:06:34 -0700 Subject: [PATCH 2/3] turn up compression level --- os/lib/make-squashfs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/lib/make-squashfs.nix b/os/lib/make-squashfs.nix index 74cba09dd..fcd7af23e 100644 --- a/os/lib/make-squashfs.nix +++ b/os/lib/make-squashfs.nix @@ -24,6 +24,6 @@ stdenv.mkDerivation { # Generate the squashfs image. mksquashfs nix-path-registration $(cat $closureInfo/store-paths) \ ${lib.optionalString (secretsDir != null) secretsDir} \ - $out -keep-as-directory -all-root -b 1048576 -comp zstd -Xcompression-level 3 + $out -keep-as-directory -all-root -b 1048576 -comp zstd ''; } From 43b61c887d3e1fc0ffe9e07cbc52133dc31eeaa3 Mon Sep 17 00:00:00 2001 From: Ryan Barry Date: Mon, 1 Apr 2024 23:14:19 -0700 Subject: [PATCH 3/3] tune compression level to balance speed & size --- os/lib/make-squashfs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/lib/make-squashfs.nix b/os/lib/make-squashfs.nix index fcd7af23e..b27e61833 100644 --- a/os/lib/make-squashfs.nix +++ b/os/lib/make-squashfs.nix @@ -24,6 +24,6 @@ stdenv.mkDerivation { # Generate the squashfs image. mksquashfs nix-path-registration $(cat $closureInfo/store-paths) \ ${lib.optionalString (secretsDir != null) secretsDir} \ - $out -keep-as-directory -all-root -b 1048576 -comp zstd + $out -keep-as-directory -all-root -b 1048576 -comp zstd -Xcompression-level 7 ''; }