Skip to content

overlay hunt: refactor tpm2-tools and tpm2-pkcs11 out of global overlay#1846

Merged
brianmcgillion merged 1 commit intotiiuae:mainfrom
vadika:overlay-hunt-tpm2
Mar 23, 2026
Merged

overlay hunt: refactor tpm2-tools and tpm2-pkcs11 out of global overlay#1846
brianmcgillion merged 1 commit intotiiuae:mainfrom
vadika:overlay-hunt-tpm2

Conversation

@vadika
Copy link
Copy Markdown
Contributor

@vadika vadika commented Mar 22, 2026

Summary

  • Move tpm2-tools and tpm2-pkcs11 package overrides from the global nixpkgs overlay into a new ghaf.security.tpm2 module (modules/common/security/tpm2-packages.nix)
  • The module exposes ghaf.security.tpm2.tools and ghaf.security.tpm2.pkcs11 package options with the same overrides (abrmd disabled, FAPI disabled for pkcs11)
  • All 6 consumer modules updated to use the module options instead of pkgs.tpm2-tools / pkgs.tpm2-pkcs11
  • Removes overlay entries and overlay directories for both packages

Motivation

Global overlays on tpm2-tools and tpm2-pkcs11 change their derivation hashes, which forces rebuilds of all transitive dependents from source instead of using binary cache. By scoping the overrides to a module, stock packages retain their cache-friendly hashes.

Changed files

  • New: modules/common/security/tpm2-packages.nix — defines ghaf.security.tpm2.{tools,pkcs11}
  • Updated: modules/common/security/default.nix — imports new module
  • Updated: modules/hardware/x86_64-generic/modules/tpm2.nix
  • Updated: modules/microvm/common/vm-tpm.nix
  • Updated: modules/microvm/common/storagevm.nix
  • Updated: modules/partitioning/deferred-disk-encryption.nix
  • Updated: modules/common/security/disk-encryption.nix
  • Updated: modules/reference/hardware/jetpack/nvidia-jetson-orin/jetson-orin.nix
  • Deleted: overlays/custom-packages/tpm2-tools/default.nix
  • Deleted: overlays/custom-packages/tpm2-pkcs11/default.nix

Test plan

  • Verify Nix evaluation succeeds for x86_64 and aarch64 targets
  • Verify tpm2-tools and tpm2-pkcs11 packages have abrmd disabled in built images
  • Verify disk encryption and TPM provisioning still work on hardware with TPM

Move tpm2-tools and tpm2-pkcs11 package overrides from the global
nixpkgs overlay into a new ghaf.security.tpm2 module that provides
scoped package options (tools and pkcs11).

Both packages disable abrmd (D-Bus TPM resource manager) since Ghaf
accesses TPM directly via the kernel resource manager (/dev/tpmrm0).
The tpm2-pkcs11 package additionally disables FAPI support.

By removing these from the global overlay, the stock tpm2-tools and
tpm2-pkcs11 derivation hashes are preserved for all packages that
depend on them transitively, allowing binary cache hits instead of
rebuilding from source.

All consumer modules (hardware/tpm2, vm-tpm, storagevm, disk-encryption,
deferred-disk-encryption, jetson-orin) now reference the module options
instead of pkgs.tpm2-tools / pkgs.tpm2-pkcs11.

Signed-off-by: Vadim Likholetov <vadikas@gmail.com>
Signed-off-by: vadik likholetov <vadikas@gmail.com>
Copy link
Copy Markdown
Contributor

@avnik avnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much "just formatting" changes, rewriting out with pkgs; etc

@brianmcgillion brianmcgillion merged commit 1036955 into tiiuae:main Mar 23, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants