Is it? Every time nixpkgs changes the python minor version all of my virtualenvs break, which is a pain. I guess I need to look into dev shell or something.
Which manages uv and pyenv and stuff for python, and package managers for just about every other language I dev in.
It’s version managers all the way down lol, but it’s the only way I’ve found to have proper declarative versions within my nix config that don’t rely on the nixpkgs ecosystem changing, and doesn’t require manually managing a package manager for every single language I use
Yes you need to use a shell to make it reproducible in the nix sense; a regular venv will try to point to the nix store or lose libraries (or try to dynamic-link stuff) when your system env changes which is why you need it to be independent of it.
I don’t bother with venvs in my own projects because nix kind of subsumes its purpose, but it’s possible to work with them still.
Something that might help: devenv. I haven’t used this personally but the UX looks like an upgrade. (I just use flakes with dev shells defined inline long-form)
If you don’t use a venv at all, do you add every new requirement to your main config.nix?
If it matters, I’m not a real developer. I don’t deploy or package anything. I’m just making tools for my own work. I’m not concerned about Nix-like reproducibility for my python scripts because they’re pretty simple and only live on my machine.
Is it? Every time nixpkgs changes the python minor version all of my virtualenvs break, which is a pain. I guess I need to look into dev shell or something.
For most dev libraries I use
https://github.com/nix-community/home-manager
Which manages
https://github.com/jdx/mise
Which manages uv and pyenv and stuff for python, and package managers for just about every other language I dev in.
It’s version managers all the way down lol, but it’s the only way I’ve found to have proper declarative versions within my nix config that don’t rely on the nixpkgs ecosystem changing, and doesn’t require manually managing a package manager for every single language I use
I use home-manager too, but maybe I’m not leveraging it enough since I’m the only user. I’ll look at Mise, thanks.
Yes you need to use a shell to make it reproducible in the nix sense; a regular venv will try to point to the nix store or lose libraries (or try to dynamic-link stuff) when your system env changes which is why you need it to be independent of it.
I don’t bother with venvs in my own projects because nix kind of subsumes its purpose, but it’s possible to work with them still.
Something that might help: devenv. I haven’t used this personally but the UX looks like an upgrade. (I just use flakes with dev shells defined inline long-form)
This video came across my feed last night, and might give you a rough idea: https://youtu.be/jldArhyi6jM&t=581
If you don’t use a venv at all, do you add every new requirement to your main config.nix?
If it matters, I’m not a real developer. I don’t deploy or package anything. I’m just making tools for my own work. I’m not concerned about Nix-like reproducibility for my python scripts because they’re pretty simple and only live on my machine.