From 3f7003b4bb6e9314ba4f65770dfdcea08a540e7b Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 26 Dec 2023 22:41:53 +0000 Subject: [PATCH] flake.nix: darwin: only expose the default --- flake.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index b0a6abd3c..2209070aa 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,7 @@ perSystem = { config, + lib, pkgs, pkgsCuda, pkgsRocm, @@ -81,15 +82,18 @@ { # We don't use the overlay here so as to avoid making too many instances of nixpkgs, # cf. https://zimbatm.com/notes/1000-instances-of-nixpkgs - packages = { - default = (pkgs.callPackage .devops/nix/scope.nix { inherit llamaVersion; }).llama-cpp; - opencl = config.packages.default.override { useOpenCL = true; }; - cuda = (pkgsCuda.callPackage .devops/nix/scope.nix { inherit llamaVersion; }).llama-cpp; - rocm = (pkgsRocm.callPackage .devops/nix/scope.nix { inherit llamaVersion; }).llama-cpp; + packages = + { + default = (pkgs.callPackage .devops/nix/scope.nix { inherit llamaVersion; }).llama-cpp; + } + // lib.optionalAttrs pkgs.stdenv.isLinux { + opencl = config.packages.default.override { useOpenCL = true; }; + cuda = (pkgsCuda.callPackage .devops/nix/scope.nix { inherit llamaVersion; }).llama-cpp; + rocm = (pkgsRocm.callPackage .devops/nix/scope.nix { inherit llamaVersion; }).llama-cpp; - mpi-cpu = config.packages.default.override { useMpi = true; }; - mpi-cuda = config.packages.default.override { useMpi = true; }; - }; + mpi-cpu = config.packages.default.override { useMpi = true; }; + mpi-cuda = config.packages.default.override { useMpi = true; }; + }; }; }; }