From 7866bc5bc7ae8ade0471ce42885eb3bd379c5289 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 14 Jul 2025 08:48:38 +0800 Subject: [PATCH] feat(darwin): Add machine platform config for darwin hosts --- nix/manifest.nix | 5 ++++- nix/modules/machine/platform.nix | 13 +++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/nix/manifest.nix b/nix/manifest.nix index 6d4698d..a4574b3 100644 --- a/nix/manifest.nix +++ b/nix/manifest.nix @@ -7,7 +7,10 @@ shell = "fish"; pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq"; }; - hosts.darwin.venus.graphical = true; + hosts.darwin.venus = { + graphical = true; + machine.platform = "intel"; + }; hosts.nixos = { nemesis = { graphical = true; diff --git a/nix/modules/machine/platform.nix b/nix/modules/machine/platform.nix index e60d4bf..08e60d4 100644 --- a/nix/modules/machine/platform.nix +++ b/nix/modules/machine/platform.nix @@ -12,9 +12,14 @@ nixpkgs.hostPlatform = "${arch}-linux"; }; - flake.modules.darwin.default.nixpkgs = { - hostPlatform = "x86_64-darwin"; - # config.allowUnsupportedSystem = true; - }; + flake.modules.darwin.default = + { hostName, ... }: + let + inherit (config.flake.manifest.hosts.darwin.${hostName}.machine) platform; + arch = if platform == "intel" then "x86_64" else "aarch64"; + in + { + nixpkgs.hostPlatform = "${arch}-darwin"; + }; }