From c04d057b9760d2db6b9cd32fe769790b01e94a59 Mon Sep 17 00:00:00 2001 From: "Thing-han, Lim" <15379156+potsrevennil@users.noreply.github.com> Date: Fri, 31 May 2024 13:22:28 +0800 Subject: [PATCH] ignore gcc for x86-64 for now and let aarch64-darwin use native clang Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> --- flake.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 7cf290898..3e6928982 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,8 @@ flake-parts.lib.mkFlake { inherit inputs; } { imports = [ ]; systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; - perSystem = { pkgs, system, ... }: + perSystem = { pkgs, ... }: let - # NOTE: For installing pkgs specific for aarch64 (not sure if there is any better way of doing this) - aarch64-system = "aarch64-" + pkgs.lib.lists.last (pkgs.lib.strings.splitString "-" system); - aarch64-pkgs = inputs.nixpkgs.legacyPackages.${aarch64-system}; core = builtins.attrValues { inherit (pkgs) @@ -29,7 +26,11 @@ nixpkgs-fmt shfmt; } - ++ [ (aarch64-pkgs.gcc13.override { propagateDoc = true; isGNU = true; }) ]; + # ignore gcc for x86_64 machines, and arch64-darwin should just use the native clang + ++ (if !pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64 + then [ (pkgs.gcc13.override { propagateDoc = true; isGNU = true; }) ] + else [ ] + ); in {