Skip to content

Commit 84e9fd9

Browse files
committed
nvtopPackages.full: mutually exclude gpus for darwin and linux
1 parent b80d043 commit 84e9fd9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pkgs/tools/system/nvtop/default.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
{ callPackage }:
1+
{ callPackage, stdenv }:
22
let
33
# this GPU families are supported "by-default" upstream (see https://github.com/Syllo/nvtop/blob/3a69c2d060298cd6f92cb09db944eded98be1c23/CMakeLists.txt#L81)
44
# coincidentally, these families are also easy to build in nixpkgs at the moment
55
defaultGPUFamilies = [ "amd" "apple" "intel" "msm" "nvidia" "panfrost" "panthor" ];
66
# these GPU families are partially supported upstream, they are also tricky to build in nixpkgs
77
# volunteers with specific hardware needed to build and test these package variants
88
additionalGPUFamilies = [ "ascend" ];
9-
defaultSupport = builtins.listToAttrs (builtins.map (gpu: { name = gpu; value = true; }) defaultGPUFamilies);
9+
defaultSupport = builtins.listToAttrs (
10+
# apple can only build on darwin, and it can't build everything else, and vice versa
11+
builtins.map (gpu: { name = gpu; value = (gpu == "apple" && stdenv.buildPlatform.isDarwin && stdenv.hostPlatform == stdenv.buildPlatform) || (gpu != "apple" && stdenv.buildPlatform.isLinux);
12+
}) defaultGPUFamilies
13+
);
1014
in
1115
{
1216
full = callPackage ./build-nvtop.nix defaultSupport; #this package supports all default GPU families
1317
}
1418
# additional packages with only one specific GPU family support
1519
// builtins.listToAttrs (builtins.map (gpu: { name = gpu; value = (callPackage ./build-nvtop.nix { "${gpu}" = true; }); }) defaultGPUFamilies)
16-
17-
18-

pkgs/top-level/all-packages.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10541,7 +10541,7 @@ with pkgs;
1054110541

1054210542
nvidia-system-monitor-qt = libsForQt5.callPackage ../tools/system/nvidia-system-monitor-qt { };
1054310543

10544-
nvtopPackages = recurseIntoAttrs (import ../tools/system/nvtop { inherit callPackage; });
10544+
nvtopPackages = recurseIntoAttrs (import ../tools/system/nvtop { inherit callPackage stdenv; });
1054510545

1054610546
inherit (callPackages ../development/libraries/ogre { })
1054710547
ogre_13 ogre_14;

0 commit comments

Comments
 (0)