···
impure-cmds = pkgs.callPackage ../os-specific/darwin/impure-cmds { };
48
-
// apple-source-packages
47
+
lib.recurseIntoAttrs (
49
+
// apple-source-packages
51
-
inherit (self.adv_cmds) ps;
52
+
inherit (self.adv_cmds) ps;
53
-
binutils-unwrapped = callPackage ../os-specific/darwin/binutils {
54
-
inherit (pkgs) cctools;
55
-
inherit (pkgs.llvmPackages) clang-unwrapped llvm llvm-manpages;
54
+
binutils-unwrapped = callPackage ../os-specific/darwin/binutils {
55
+
inherit (pkgs) cctools;
56
+
inherit (pkgs.llvmPackages) clang-unwrapped llvm llvm-manpages;
58
-
binutils = pkgs.wrapBintoolsWith {
59
-
inherit (targetPackages) libc;
60
-
bintools = self.binutils-unwrapped;
59
+
binutils = pkgs.wrapBintoolsWith {
60
+
inherit (targetPackages) libc;
61
+
bintools = self.binutils-unwrapped;
63
-
# x86-64 Darwin gnat-bootstrap emits assembly
64
-
# with MOVQ as the mnemonic for quadword interunit moves
65
-
# such as `movq %rbp, %xmm0`.
66
-
# The clang integrated assembler recognises this as valid,
67
-
# but unfortunately the cctools.gas GNU assembler does not;
68
-
# it instead uses MOVD as the mnemonic.
69
-
# The assembly that a GCC build emits is determined at build time
70
-
# and cannot be changed afterwards.
72
-
# To build GNAT on x86-64 Darwin, therefore,
73
-
# we need both the clang _and_ the cctools.gas assemblers to be available:
74
-
# the former to build at least the stage1 compiler,
75
-
# and the latter at least to be detectable
76
-
# as the target for the final compiler.
77
-
binutilsDualAs-unwrapped = pkgs.buildEnv {
78
-
name = "${lib.getName self.binutils-unwrapped}-dualas-${lib.getVersion self.binutils-unwrapped}";
80
-
self.binutils-unwrapped
81
-
(lib.getOutput "gas" pkgs.cctools)
64
+
# x86-64 Darwin gnat-bootstrap emits assembly
65
+
# with MOVQ as the mnemonic for quadword interunit moves
66
+
# such as `movq %rbp, %xmm0`.
67
+
# The clang integrated assembler recognises this as valid,
68
+
# but unfortunately the cctools.gas GNU assembler does not;
69
+
# it instead uses MOVD as the mnemonic.
70
+
# The assembly that a GCC build emits is determined at build time
71
+
# and cannot be changed afterwards.
73
+
# To build GNAT on x86-64 Darwin, therefore,
74
+
# we need both the clang _and_ the cctools.gas assemblers to be available:
75
+
# the former to build at least the stage1 compiler,
76
+
# and the latter at least to be detectable
77
+
# as the target for the final compiler.
78
+
binutilsDualAs-unwrapped = pkgs.buildEnv {
79
+
name = "${lib.getName self.binutils-unwrapped}-dualas-${lib.getVersion self.binutils-unwrapped}";
81
+
self.binutils-unwrapped
82
+
(lib.getOutput "gas" pkgs.cctools)
85
-
binutilsDualAs = self.binutils.override {
86
-
bintools = self.binutilsDualAs-unwrapped;
86
+
binutilsDualAs = self.binutils.override {
87
+
bintools = self.binutilsDualAs-unwrapped;
89
-
binutilsNoLibc = pkgs.wrapBintoolsWith {
90
-
libc = targetPackages.preLibcHeaders;
91
-
bintools = self.binutils-unwrapped;
90
+
binutilsNoLibc = pkgs.wrapBintoolsWith {
91
+
libc = targetPackages.preLibcHeaders;
92
+
bintools = self.binutils-unwrapped;
94
-
# Removes propagated packages from the stdenv, so those packages can be built without depending upon themselves.
95
-
bootstrapStdenv = mkBootstrapStdenv pkgs.stdenv;
95
+
# Removes propagated packages from the stdenv, so those packages can be built without depending upon themselves.
96
+
bootstrapStdenv = mkBootstrapStdenv pkgs.stdenv;
97
-
libSystem = callPackage ../os-specific/darwin/libSystem { };
98
+
libSystem = callPackage ../os-specific/darwin/libSystem { };
99
-
DarwinTools = callPackage ../os-specific/darwin/DarwinTools { };
100
+
DarwinTools = callPackage ../os-specific/darwin/DarwinTools { };
101
-
libunwind = callPackage ../os-specific/darwin/libunwind { };
102
+
libunwind = callPackage ../os-specific/darwin/libunwind { };
103
-
sigtool = callPackage ../os-specific/darwin/sigtool { };
104
+
sigtool = callPackage ../os-specific/darwin/sigtool { };
105
-
signingUtils = callPackage ../os-specific/darwin/signing-utils { };
106
+
signingUtils = callPackage ../os-specific/darwin/signing-utils { };
107
-
autoSignDarwinBinariesHook = pkgs.makeSetupHook {
108
-
name = "auto-sign-darwin-binaries-hook";
109
-
propagatedBuildInputs = [ self.signingUtils ];
110
-
} ../os-specific/darwin/signing-utils/auto-sign-hook.sh;
108
+
autoSignDarwinBinariesHook = pkgs.makeSetupHook {
109
+
name = "auto-sign-darwin-binaries-hook";
110
+
propagatedBuildInputs = [ self.signingUtils ];
111
+
} ../os-specific/darwin/signing-utils/auto-sign-hook.sh;
112
-
iosSdkPkgs = callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix {
113
-
buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk;
114
-
targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs;
115
-
inherit (pkgs.llvmPackages) clang-unwrapped;
113
+
iosSdkPkgs = callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix {
114
+
buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk;
115
+
targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs;
116
+
inherit (pkgs.llvmPackages) clang-unwrapped;
118
-
lsusb = callPackage ../os-specific/darwin/lsusb { };
119
+
lsusb = callPackage ../os-specific/darwin/lsusb { };
120
-
openwith = callPackage ../os-specific/darwin/openwith { };
121
+
openwith = callPackage ../os-specific/darwin/openwith { };
122
-
trash = callPackage ../os-specific/darwin/trash { };
123
+
trash = callPackage ../os-specific/darwin/trash { };
124
-
inherit (self.file_cmds) xattr;
125
+
inherit (self.file_cmds) xattr;
126
-
inherit (pkgs.callPackages ../os-specific/darwin/xcode { })
127
+
inherit (pkgs.callPackages ../os-specific/darwin/xcode { })
179
+
xcodeProjectCheckHook = pkgs.makeSetupHook {
180
+
name = "xcode-project-check-hook";
181
+
propagatedBuildInputs = [ pkgs.pkgsBuildHost.openssl ];
182
+
} ../os-specific/darwin/xcode-project-check-hook/setup-hook.sh;
178
-
xcodeProjectCheckHook = pkgs.makeSetupHook {
179
-
name = "xcode-project-check-hook";
180
-
propagatedBuildInputs = [ pkgs.pkgsBuildHost.openssl ];
181
-
} ../os-specific/darwin/xcode-project-check-hook/setup-hook.sh;
184
+
# See doc/packages/darwin-builder.section.md
185
+
linux-builder = lib.makeOverridable (
188
+
toGuest = builtins.replaceStrings [ "darwin" ] [ "linux" ];
183
-
# See doc/packages/darwin-builder.section.md
184
-
linux-builder = lib.makeOverridable (
187
-
toGuest = builtins.replaceStrings [ "darwin" ] [ "linux" ];
190
+
nixos = import ../../nixos {
193
+
../../nixos/modules/profiles/nix-builder-vm.nix
189
-
nixos = import ../../nixos {
192
-
../../nixos/modules/profiles/nix-builder-vm.nix
197
+
# If you need to override this, consider starting with the right Nixpkgs
198
+
# in the first place, ie change `pkgs` in `pkgs.darwin.linux-builder`.
199
+
# or if you're creating new wiring that's not `pkgs`-centric, perhaps use the
200
+
# macos-builder profile directly.
201
+
virtualisation.host = { inherit pkgs; };
196
-
# If you need to override this, consider starting with the right Nixpkgs
197
-
# in the first place, ie change `pkgs` in `pkgs.darwin.linux-builder`.
198
-
# or if you're creating new wiring that's not `pkgs`-centric, perhaps use the
199
-
# macos-builder profile directly.
200
-
virtualisation.host = { inherit pkgs; };
203
+
nixpkgs.hostPlatform = lib.mkDefault (toGuest stdenv.hostPlatform.system);
202
-
nixpkgs.hostPlatform = lib.mkDefault (toGuest stdenv.hostPlatform.system);
210
+
nixos.config.system.build.macos-builder-installer
211
+
) { modules = [ ]; };
209
-
nixos.config.system.build.macos-builder-installer
210
-
) { modules = [ ]; };
213
+
linux-builder-x86_64 = self.linux-builder.override {
214
+
modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ];
212
-
linux-builder-x86_64 = self.linux-builder.override {
213
-
modules = [ { nixpkgs.hostPlatform = "x86_64-linux"; } ];