Commit b3a96e6a authored by abysssol's avatar abysssol
Browse files

ollama: move `goBuild` environment variables to `env`

parent d276d38b
Loading
Loading
Loading
Loading
+109 −108
Original line number Diff line number Diff line
@@ -114,13 +114,7 @@ let
    if enableCuda then buildGoModule.override { stdenv = overrideCC stdenv gcc12; } else buildGoModule;
  inherit (lib) licenses platforms maintainers;
in
goBuild (
  (lib.optionalAttrs enableRocm {
    ROCM_PATH = rocmPath;
    CLBlast_DIR = "${clblast}/lib/cmake/CLBlast";
  })
  // (lib.optionalAttrs enableCuda { CUDA_LIB_DIR = "${cudaToolkit}/lib"; })
  // {
goBuild {
  inherit
    pname
    version
@@ -128,6 +122,13 @@ goBuild (
    vendorHash
    ;

  env =
    lib.optionalAttrs enableRocm {
      ROCM_PATH = rocmPath;
      CLBlast_DIR = "${clblast}/lib/cmake/CLBlast";
    }
    // lib.optionalAttrs enableCuda { CUDA_LIB_DIR = "${cudaToolkit}/lib"; };

  nativeBuildInputs =
    [ cmake ]
    ++ lib.optionals enableRocm [ rocmPackages.llvm.bintools ]
@@ -177,6 +178,7 @@ goBuild (
    # build llama.cpp libraries for ollama
    go generate ./...
  '';

  postFixup =
    ''
      # the app doesn't appear functional at the moment, so hide it
@@ -227,4 +229,3 @@ goBuild (
    ];
  };
}
)