@@ -134,6 +134,7 @@ rec {
134134
135135 kernelFamilies = setTypes types.openKernelFamily {
136136 bsd = {};
137+ darwin = {};
137138 };
138139
139140 ################################################################################
@@ -149,7 +150,10 @@ rec {
149150 types.kernel = enum (attrValues kernels);
150151
151152 kernels = with execFormats; with kernelFamilies; setTypes types.openKernel {
152− darwin = { execFormat = macho; families = { }; };
153+ # TODO(@Ericson2314): Don't want to mass-rebuild yet to keeping 'darwin' as
154+ # the nnormalized name for macOS.
155+ macos = { execFormat = macho; families = { inherit darwin; }; name = "darwin"; };
156+ ios = { execFormat = macho; families = { inherit darwin; }; };
153157 freebsd = { execFormat = elf; families = { inherit bsd; }; };
154158 hurd = { execFormat = elf; families = { }; };
155159 linux = { execFormat = elf; families = { }; };
@@ -159,9 +163,13 @@ rec {
159163 solaris = { execFormat = elf; families = { }; };
160164 windows = { execFormat = pe; families = { }; };
161165 } // { # aliases
166+ # 'darwin' is the kernel for all of them. We choose macOS by default.
167+ darwin = kernels.macos;
162168 # TODO(@Ericson2314): Handle these Darwin version suffixes more generally.
163− darwin10 = kernels.darwin;
164− darwin14 = kernels.darwin;
169+ darwin10 = kernels.macos;
170+ darwin14 = kernels.macos;
171+ watchos = kernels.ios;
172+ tvos = kernels.ios;
165173 win32 = kernels.windows;
166174 };
167175
@@ -263,8 +271,8 @@ rec {
263271 mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s));
264272
265273 doubleFromSystem = { cpu, vendor, kernel, abi, ... }:
266− if abi == abis.cygnus
267− then "${cpu.name}-cygwin"
274+ /**/ if abi == abis.cygnus then "${cpu.name}-cygwin"
275+ else if kernel.families ? darwin then "${cpu.name}-darwin"
268276 else "${cpu.name}-${kernel.name}";
269277
270278 tripleFromSystem = { cpu, vendor, kernel, abi, ... } @ sys: assert isSystem sys; let