embeds/devenv.nix
2024-11-27 22:29:30 +07:00

65 lines
1.7 KiB
Nix

{ pkgs, lib, config, inputs, ... }:
{
# https://devenv.sh/basics/
env.GREET = "devenv";
env.PYTHON_KEYRING_BACKEND= "keyring.backends.fail.Keyring";
env.CUDA_HOME = pkgs.cudaPackages.cudatoolkit;
env.CUDA_PATH = pkgs.cudaPackages.cudatoolkit;
env.LD_LIBRARY_PATH = "/run/opengl-driver/lib:$LD_LIBRARY_PATH";
env.CUDA_VISIBLE_DEVICES="0";
env.PYTORCH_CUDA_ALLOC_CONF="max_split_size_mb:256";
env.EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib";
env.EXTRA_CCFLAGS="-I/usr/include";
# env.LD_LIBRARY_PATH = ":${pkgs.cudatoolkit}/lib:${pkgs.cudatoolkit}/lib64:${pkgs.cudatoolkit}/host-linux-x64/Mesa";
# https://devenv.sh/packages/
packages = with pkgs;[
git
python311Packages.python-lsp-server
cudaPackages.cudatoolkit
# gitRepo gnupg autoconf curl
# procps gnumake utillinux m4 gperf unzip
# linuxPackages.nvidia_x11
# libGLU
# xorg.libXi xorg.libXmu freeglut
# xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib
# ncurses5 stdenv.cc binutils
# cudaPackages.libcublas
# cudaPackages.cudnn
];
# https://devenv.sh/scripts/
scripts.hello.exec = "echo hello from $GREET";
enterShell = ''
hello
git --version
'';
# https://devenv.sh/tests/
enterTest = ''
echo "Running tests"
git --version | grep "2.42.0"
'';
# https://devenv.sh/services/
# services.postgres.enable = true;
# https://devenv.sh/languages/
# languages.nix.enable = true;
languages.python = {
enable = true;
venv.enable = true;
};
# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;
# https://devenv.sh/processes/
# processes.ping.exec = "ping example.com";
# See full reference at https://devenv.sh/reference/options/
}