diff options
Diffstat (limited to 'cuda/python')
-rw-r--r-- | cuda/python/.envrc | 10 | ||||
-rw-r--r-- | cuda/python/.gitignore | 9 | ||||
-rw-r--r-- | cuda/python/devenv.lock | 103 | ||||
-rw-r--r-- | cuda/python/devenv.nix | 89 | ||||
-rw-r--r-- | cuda/python/devenv.yaml | 16 |
5 files changed, 227 insertions, 0 deletions
diff --git a/cuda/python/.envrc b/cuda/python/.envrc new file mode 100644 index 0000000..7e9a2d6 --- /dev/null +++ b/cuda/python/.envrc @@ -0,0 +1,10 @@ +export DIRENV_WARN_TIMEOUT=20s + +eval "$(devenv direnvrc)" + +# `use devenv` supports the same options as the `devenv shell` command. +# +# To silence the output, use `--quiet`. +# +# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true +use devenv diff --git a/cuda/python/.gitignore b/cuda/python/.gitignore new file mode 100644 index 0000000..4d058db --- /dev/null +++ b/cuda/python/.gitignore @@ -0,0 +1,9 @@ +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/cuda/python/devenv.lock b/cuda/python/devenv.lock new file mode 100644 index 0000000..be967d0 --- /dev/null +++ b/cuda/python/devenv.lock @@ -0,0 +1,103 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1758469077, + "owner": "cachix", + "repo": "devenv", + "rev": "0a84e6e5cd0ab128a9336f77a86a2d3f4a5b5dee", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758108966, + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1755783167, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "4a880fb247d24fbca57269af672e8f78935b0328", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": [ + "git-hooks" + ] + } + } + }, + "root": "root", + "version": 7 +} diff --git a/cuda/python/devenv.nix b/cuda/python/devenv.nix new file mode 100644 index 0000000..c32e55f --- /dev/null +++ b/cuda/python/devenv.nix @@ -0,0 +1,89 @@ +{ + pkgs, + lib, + config, + inputs, + ... +}: let + cpkgs = import inputs.nixpkgs { + system = pkgs.system; + config = { + allowUnfree = true; + cudaSupport = true; + }; + }; +in { + # https://devenv.sh/basics/ + env.GREET = "devenv"; + + # env.LD_LIBRARY_PATH = "/run/opengl-driver/lib"; + # env.LD_LIBRARY_PATH = "${pkgs.glibc}/lib"; + # env.CUDA_HOME = pkgs.cudaPackages.cudatoolkit; + # env.CUDA_PATH = pkgs.cudaPackages.cudatoolkit; + + # env.LD_LIBRARY_PATH = "/run/opengl-driver/lib:" + lib.makeLibraryPath config.packages; + # env.LD_LIBRARY_PATH = "/run/opengl-driver/lib"; + # # # Ensure Nix packages are discoverable by Python + # env.PYTHONPATH = lib.makeSearchPath "lib/python3.13/site-packages" pythonPkgs; + + # https://devenv.sh/packages/ + packages = with cpkgs; [ + git + # glib + # glibc + # libGL + # libGLU + # cudaPackages.cudatoolkit + # cudaPackages.cuda_cccl + # cudaPackages.cudnn + # cudaPackages.cuda_nvcc + # stdenv.cc.cc.lib + # zlib + python3.withPackages + (ps: + with ps; [ + torch + ]) + ]; + + # https://devenv.sh/languages/ + # languages.rust.enable = true; + + languages.python = { + enable = true; + venv.enable = true; + }; + # https://devenv.sh/processes/ + # processes.dev.exec = "${lib.getExe pkgs.watchexec} -n -- ls -la"; + + # https://devenv.sh/services/ + # services.postgres.enable = true; + + # https://devenv.sh/scripts/ + scripts.hello.exec = '' + echo hello from $GREET + ''; + + # https://devenv.sh/basics/ + enterShell = '' + hello # Run scripts directly + git --version # Use packages + ''; + + # https://devenv.sh/tasks/ + # tasks = { + # "myproj:setup".exec = "mytool build"; + # "devenv:enterShell".after = [ "myproj:setup" ]; + # }; + + # https://devenv.sh/tests/ + enterTest = '' + echo "Running tests" + git --version | grep --color=auto "${pkgs.git.version}" + ''; + + # https://devenv.sh/git-hooks/ + # git-hooks.hooks.shellcheck.enable = true; + + # See full reference at https://devenv.sh/reference/options/ +} diff --git a/cuda/python/devenv.yaml b/cuda/python/devenv.yaml new file mode 100644 index 0000000..2518b10 --- /dev/null +++ b/cuda/python/devenv.yaml @@ -0,0 +1,16 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + +# If you're using non-OSS software, you can set allowUnfree to true. +allowUnfree: true +cudaSupport: true + +# If you're willing to use a package that's vulnerable +# permittedInsecurePackages: +# - "openssl-1.1.1w" + +# If you have more than one devenv you can merge them +#imports: +# - ./backend |