# CUDA working with poetry2nix

**URL:** https://discourse.nixos.org/t/cuda-working-with-poetry2nix/58208
**Category:** Help
**Created:** [January 2, 2025, 9:43pm UTC](https://discourse.nixos.org/t/cuda-working-with-poetry2nix/58208 "2025-01-02T21:43:16Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![DavidRConnell](https://discourse.nixos.org/user_avatar/discourse.nixos.org/davidrconnell/32/4709_2.png) [@DavidRConnell](https://discourse.nixos.org/u/DavidRConnell)
#### Post date: [January 26, 2025, 5:37am UTC](https://discourse.nixos.org/t/cuda-working-with-poetry2nix/58208/8 "2025-01-26T05:37:02Z")

</div>

I tried both `cuda12` and when that failed, `cuda12-local`. I tried to pretty much copy your example modified only where needed but I’m sure I missed something. I’ve already deleted my original attempts and not going to try again right now. I’ll get back to this at some point, and again, I’m pretty confident I just dropped something from your example.

> [@erolm\_a](#):
>
> but you likely got this backwards: by default it creates new derivations based on what pyproject declares, and only fetches what’s in the nixpkgs if you explicitly tell it to (hence the hacks).

For `uv2nix` yes but (as far as I can tell) the base `pyproject-nix` does not have its own builder, instead it parses the pyporject.toml and nixifies the package names, then returns a function containing the lists of packages to get from a python package set that get passed to a `python3.withPackages`.

For example my flake looks like this:

```nix
project = pyproject-nix.lib.project.loadPyproject { projectRoot = ./.; };
python = pkgs.python3;

pyEnv = python.withPackages (project.renderers.withPackages {
  inherit python;
  groups = ["dev"];
});

```

And I can override my nixpkgs’ python to pass it new `buildPythonPackage` recipes to use. For example, I have a couple packages on PyPI I use that aren’t prebuilt by nix and the flake fails unless I write the derivation.

The `uv2nix` adds in a uv.lock parser that then writes its own derivatives. So I don’t have the exact packages described by uv in my environment but I’m more concerned about getting an environment set up on both my computer and a server so as long as `uv add` works, that’s good enough for now.

---

_[View the full topic](https://discourse.nixos.org/t/cuda-working-with-poetry2nix/58208)._
