Skip to content

Commit df138f3

Browse files
committed
Use virtualisation.rosetta instead of manual set up
1 parent 2f2f62f commit df138f3

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

nixos-modules/microvm/rosetta.nix

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
{ config, lib, pkgs, ... }:
2-
3-
let
4-
cfg = config.microvm.vfkit.rosetta;
5-
mountPoint = "/run/rosetta";
6-
mountTag = "rosetta";
7-
in
8-
lib.mkIf (config.microvm.hypervisor == "vfkit" && cfg.enable) {
9-
fileSystems.${mountPoint} = {
10-
device = mountTag;
11-
fsType = "virtiofs";
12-
};
13-
14-
boot.binfmt.registrations.rosetta = {
15-
interpreter = "${mountPoint}/rosetta";
16-
magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00'';
17-
mask = ''\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'';
18-
};
1+
{ config, lib, ... }:
2+
lib.mkIf (config.microvm.hypervisor == "vfkit" && config.microvm.vfkit.rosetta.enable) {
3+
virtualisation.rosetta.enable = true;
194
}

0 commit comments

Comments
 (0)