From: Demi Marie Obenour <demiobenour@gmail.com>
To: Spectrum OS Development <devel@spectrum-os.org>
Cc: Alyssa Ross <hi@alyssa.is>, Demi Marie Obenour <demiobenour@gmail.com>
Subject: [PATCH] Add dontFixup=true to derivations that build images
Date: Sat, 25 Oct 2025 14:06:31 -0400 [thread overview]
Message-ID: <20251025-dont-fixup-v1-1-9e10c24efbc3@gmail.com> (raw)
This prevents lengthy and pointless scans of large image files.
dontFixup is added to the derivations that already used
unsafeDiscardReferences. Both dontFixup and unsafeDiscardReferences are
added to a derivation that builds an ext4 filesystem image.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
host/initramfs/default.nix | 3 +++
host/rootfs/default.nix | 1 +
img/app/default.nix | 2 ++
release/checks/integration/default.nix | 2 ++
release/combined/default.nix | 3 +++
release/combined/eosimages.nix | 1 +
release/live/default.nix | 2 ++
vm-lib/make-vm.nix | 1 +
vm/sys/net/default.nix | 2 ++
9 files changed, 17 insertions(+)
diff --git a/host/initramfs/default.nix b/host/initramfs/default.nix
index a3672bfeb7002f81bf67bfc13c0b757d46b93d66..51305a7da1645ca63f1c9b2f07a15aa0d5659ff2 100644
--- a/host/initramfs/default.nix
+++ b/host/initramfs/default.nix
@@ -63,6 +63,7 @@ let
nativeBuildInputs = [ cpio ];
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
} ''
cpio -id < ${microcodeAmd}/amd-ucode.img
cpio -id < ${microcodeIntel}/intel-ucode.img
@@ -82,6 +83,7 @@ let
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
} ''
cd ${packagesSysroot}
(printf "%s\n" "''${storePrefixes[@]}" && find . $(< $storePaths)) |
@@ -118,6 +120,7 @@ stdenvNoCC.mkDerivation {
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
passthru = { inherit packagesSysroot; };
}
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index 484a43f372f934e6b3be0c383d12c9eabf2f7171..1673a83e9d70da6f22fa71c4a79e0eaeff309fc2 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -195,6 +195,7 @@ stdenvNoCC.mkDerivation {
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
passthru = {
inherit appvm firmware kernel nixosAllHardware packagesSysroot pkgsGui;
diff --git a/img/app/default.nix b/img/app/default.nix
index 2863cbdfc067c8a6de018e5f0920d00878cf96ff..5cd381e837db3057590c075cf2b33a486cc188bc 100644
--- a/img/app/default.nix
+++ b/img/app/default.nix
@@ -134,6 +134,8 @@ stdenvNoCC.mkDerivation {
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
+
meta = with lib; {
license = licenses.eupl12;
platforms = platforms.linux;
diff --git a/release/checks/integration/default.nix b/release/checks/integration/default.nix
index 570918613e083b0c2d7c82486544b6405ae5ea89..582a4be8df3098ddaf318b7dac60690c2f8b2304 100644
--- a/release/checks/integration/default.nix
+++ b/release/checks/integration/default.nix
@@ -37,6 +37,8 @@ let
userData = runCommand "user-data.img" {
nativeBuildInputs = [ e2fsprogs tar2ext4 ];
+ unsafeDiscardReferences = true;
+ dontFixup = true;
} ''
tar -Pcvf root.tar \
--transform=s,^${appimage},test.appimage, ${appimage} \
diff --git a/release/combined/default.nix b/release/combined/default.nix
index 5c917951f845ee94871a0532f3145493f8ee06ba..cb64f34bef9c397014d7303da39497e1216a2a62 100644
--- a/release/combined/default.nix
+++ b/release/combined/default.nix
@@ -31,6 +31,7 @@ let
nativeBuildInputs = [ squashfs-tools-ng ];
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
} ''
sed 's,^${storeDir}/,,' ${writeClosure [ installer.store ]} |
tar -C ${storeDir} -c --verbatim-files-from -T - \
@@ -64,6 +65,7 @@ let
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
passthru = { inherit grubCfg; };
} ''
@@ -91,6 +93,7 @@ runCommand "spectrum-installer" {
nativeBuildInputs = [ grub jq util-linux systemdMinimal ];
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
passthru = { inherit eosimages esp installer rootfs; };
} ''
blockSize() {
diff --git a/release/combined/eosimages.nix b/release/combined/eosimages.nix
index 351265bbd54a04b1c1fd3aa6f4c23dad57bd4395..0ac4c48374e7098a2b91f61fc07cebb2042ffbdc 100644
--- a/release/combined/eosimages.nix
+++ b/release/combined/eosimages.nix
@@ -10,6 +10,7 @@ runCommand "eosimages.img" {
image = callSpectrumPackage ../live {};
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
} ''
mkdir dir
cd dir
diff --git a/release/live/default.nix b/release/live/default.nix
index 7a856149de4c736fd850fa37b9f09db9715007a0..5320ce0ecbd7e8912d91f725327a4cfd3d456a54 100644
--- a/release/live/default.nix
+++ b/release/live/default.nix
@@ -63,6 +63,8 @@ stdenv.mkDerivation {
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
+
passthru = { inherit initramfs rootfs; };
}
) (_: {})
diff --git a/vm-lib/make-vm.nix b/vm-lib/make-vm.nix
index 0812b8ea53404c620829fc79bb61005e0bc75b8d..ea7ace99034029325405bd237b8fd50e071bb358 100644
--- a/vm-lib/make-vm.nix
+++ b/vm-lib/make-vm.nix
@@ -31,6 +31,7 @@ runCommand "spectrum-vm" {
__structuredAttrs = true;
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
} ''
mkdir -p $out/{blk,fs,providers}
pushd "$out"
diff --git a/vm/sys/net/default.nix b/vm/sys/net/default.nix
index b8dc964dd75eccf230cac285dd2a32e7fd75dc9a..478545d2680025a99c2032689c6cc7011dc851c8 100644
--- a/vm/sys/net/default.nix
+++ b/vm/sys/net/default.nix
@@ -132,6 +132,8 @@ stdenvNoCC.mkDerivation {
unsafeDiscardReferences = { out = true; };
+ dontFixup = true;
+
passthru = { inherit firmware kernel packagesSysroot; };
meta = with lib; {
---
base-commit: db54efac07deee32f39bdec4e4b8b73674df18c7
change-id: 20251025-dont-fixup-5389ba1b0b7f
--
Sincerely,
Demi Marie Obenour (she/her/hers)
next reply other threads:[~2025-10-25 18:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-25 18:06 Demi Marie Obenour [this message]
2025-10-28 12:57 ` [PATCH] Add dontFixup=true to derivations that build images Alyssa Ross
2025-10-28 22:37 ` Demi Marie Obenour
2025-10-28 13:37 ` Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251025-dont-fixup-v1-1-9e10c24efbc3@gmail.com \
--to=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
--cc=hi@alyssa.is \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).