From bb5ee1fe60d560cf12a83bb668e8763c777cd920 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 24 Jul 2023 04:00:24 -0700 Subject: [PATCH] default-gcc-version: init This commit lifts the default gcc version to a top-level attribute so it can be overridden. --- pkgs/top-level/all-packages.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 260974f0e50b..6497488ddb77 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15664,14 +15664,12 @@ with pkgs; gbforth = callPackage ../development/compilers/gbforth { }; - inherit (let - num = - if (with stdenv.targetPlatform; isVc4 || libc == "relibc") then 6 - else 12; - numS = toString num; - in { - gcc = pkgs.${"gcc${numS}"}; - gccFun = callPackage (../development/compilers/gcc + "/${numS}"); + default-gcc-version = + if (with stdenv.targetPlatform; isVc4 || libc == "relibc") then 6 + else 12; + inherit ({ + gcc = pkgs.${"gcc${toString default-gcc-version}"}; + gccFun = callPackage (../development/compilers/gcc + "/${toString default-gcc-version}"); }) gcc gccFun; gcc-unwrapped = gcc.cc;