From f2b6128f10d9166d4ddf2ec64c08f4fc73f418ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Tue, 28 Jul 2026 16:47:00 +0200 Subject: [PATCH] Ensure Rosetta on cm * Install Rosetta during activation when it is missing so amd64 containers have the macOS translation support they need. * Gate the activation step to Apple Silicon hosts because Rosetta is not available on Intel Macs. --- hosts/cm.nix | 1 + modules/rosetta.nix | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 modules/rosetta.nix diff --git a/hosts/cm.nix b/hosts/cm.nix index bacd9c9..7b2d1f2 100644 --- a/hosts/cm.nix +++ b/hosts/cm.nix @@ -8,6 +8,7 @@ ../modules/sudo.nix ../modules/homebrew.nix ../modules/account.nix + ../modules/rosetta.nix ]; }; diff --git a/modules/rosetta.nix b/modules/rosetta.nix new file mode 100644 index 0000000..ad3efd2 --- /dev/null +++ b/modules/rosetta.nix @@ -0,0 +1,9 @@ +{ lib, pkgs, ... }: + +{ + system.activationScripts.postActivation.text = lib.mkIf pkgs.stdenv.hostPlatform.isAarch64 '' + if ! /usr/sbin/pkgutil --pkg-info com.apple.pkg.RosettaUpdateAuto >/dev/null 2>&1; then + /usr/sbin/softwareupdate --install-rosetta --agree-to-license + fi + ''; +} -- 2.51.2