From 0b9b09eee60cd63b3be6b859efae4a41670a18b8 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Fri, 23 Dec 2022 13:37:05 -0600 Subject: [PATCH] darwin.builder: Fix supported platforms See: https://github.com/NixOS/nixpkgs/issues/108984#issuecomment-1364263324 Before this change the supported platforms were unspecified, so it would default to being only built on `x86_64-linux`. This fixes that so that hydra.nixos.org builds and caches the Darwin build products instead --- nixos/modules/profiles/macos-builder.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nixos/modules/profiles/macos-builder.nix b/nixos/modules/profiles/macos-builder.nix index 895dd04cb485..77f3224a7294 100644 --- a/nixos/modules/profiles/macos-builder.nix +++ b/nixos/modules/profiles/macos-builder.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let keysDirectory = "/var/keys"; @@ -71,8 +71,7 @@ in hostPkgs = config.virtualisation.host.pkgs; - in - hostPkgs.writeShellScriptBin "create-builder" '' + script = hostPkgs.writeShellScriptBin "create-builder" '' KEYS="''${KEYS:-./keys}" ${hostPkgs.coreutils}/bin/mkdir --parent "''${KEYS}" PRIVATE_KEY="''${KEYS}/${user}_${keyType}" @@ -87,6 +86,13 @@ in KEYS="$(nix-store --add "$KEYS")" ${config.system.build.vm}/bin/run-nixos-vm ''; + in + script.overrideAttrs (old: { + meta = (old.meta or { }) // { + platforms = lib.platforms.darwin; + }; + }); + system.stateVersion = "22.05"; users.users."${user}"= {