-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
39 lines (37 loc) · 1.58 KB
/
flake.nix
File metadata and controls
39 lines (37 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
description = "Packaging of patched RosettaLinux";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }: let
forAllSystems = with nixpkgs.lib; genAttrs platforms.all;
forAllPkgs = pkgsWith: forAllSystems (system: pkgsWith nixpkgs.legacyPackages.${system});
in {
packages = forAllPkgs (pkgs: with pkgs; {
default = stdenvNoCC.mkDerivation {
pname = "rosetta";
version = "15.4-beta-4-24E5238a";
src = fetchurl {
url = "https://swcdn.apple.com/content/downloads/54/11/082-08305-A_VN60L27NBN/f2f9wkhllglu1zhe6y47n0wsjemdi46b8g/RosettaUpdateAuto.pkg";
hash = "sha256-oMeLOFtH/AMjHKClvwgfce78vVrsMA5eyaWIUFIbf0g=";
};
nativeBuildInputs = [ p7zip ];
unpackPhase = ''
7z x $src
7z x Payload~
'';
installPhase = ''
install -Dm755 -t $out/bin Library/Apple/usr/libexec/oah/RosettaLinux/*
'';
fixupPhase = ''
dd if=<(printf '\x1f\x20\x03\xd5') of=$out/bin/rosetta bs=1 seek=196748 conv=notrunc
dd if=<(printf '\x1f\x20\x03\xd5') of=$out/bin/rosetta bs=1 seek=196776 conv=notrunc
dd if=<(printf '\x1f\x20\x03\xd5') of=$out/bin/rosetta bs=1 seek=201340 conv=notrunc
'';
meta = with lib; {
description = "A dynamic binary translator to run x86_64 binaries under ARM Linux";
homepage = "https://developer.apple.com/documentation/virtualization/running-intel-binaries-in-linux-vms-with-rosetta";
platforms = platforms.all;
};
};
});
};
}