To build on NixOS: nix-shell --run 'go generate ./... && go build .'
This commit is contained in:
parent
a4564232a4
commit
6eb3cddcb6
1 changed files with 24 additions and 0 deletions
24
default.nix
Normal file
24
default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
with (import <nixpkgs> {});
|
||||||
|
let
|
||||||
|
LLP = with pkgs; [
|
||||||
|
gcc11
|
||||||
|
cudatoolkit
|
||||||
|
linuxPackages.nvidia_x11
|
||||||
|
go
|
||||||
|
cmake
|
||||||
|
];
|
||||||
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath LLP;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "ollama-env";
|
||||||
|
buildInputs = LLP;
|
||||||
|
src = null;
|
||||||
|
# IMPORTANT: Edit ./llm/generate/gen_linux.sh
|
||||||
|
shellHook = ''
|
||||||
|
SOURCE_DATE_EPOCH=$(date +%s)
|
||||||
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
||||||
|
export CUDA_LIB_DIR=${cudatoolkit.out}/lib
|
||||||
|
export CUDART_LIB_DIR=${cudatoolkit.lib}/lib
|
||||||
|
export NVCC_PREPEND_FLAGS='-ccbin ${gcc11}/bin/'
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue