about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGabriella Gonzalez <Gabriel439@gmail.com>2022-12-23 13:37:05 -0600
committerGabriella Gonzalez <Gabriel439@gmail.com>2022-12-23 13:38:34 -0600
commit0b9b09eee60cd63b3be6b859efae4a41670a18b8 (patch)
tree7049c5ff26dd8dc322fbf1a19b68f1665ee7b86e /nixos
parentb0632a2de5a0b37beeb5b932171daf6502b6a0f7 (diff)
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
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/profiles/macos-builder.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/nixos/modules/profiles/macos-builder.nix b/nixos/modules/profiles/macos-builder.nix
index 895dd04cb4852..77f3224a72941 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}"= {