Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flake): complete revamp with devenv/direnv
Not perfect, and mostly a port of the previous edition. Hours have already been sunk into this, and need to get this out for consumption, and for ironing out. For more information see: https://devenv.sh NOTE: impure is used only because of the devenv-managed state, do not be alarmed!
- Loading branch information
cb4798b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a NixOS user (there are dozens of us!), I greatly appreciate the changes here. I had been trying for days to get TagStudio to even open, but now I can just run
nix develop --impure
and thenpython3 tagstudio/tag_studio.py
and everything just works. Thank you very much for the work you put into this commit. It does not go unnoticed.cb4798b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the kind words! By the way, I'd recommend looking into direnv! This will automatically enable development environments when that
.envrc
file is present.Home Manager has options for it:
Lastly, I made a small script/alias that does the python command for you, just use
tagstudio
in your shell. Slightly less typing. ;)I hope to improve upon this further, but things are already in a much better state. Thanks again for the appreciation!
cb4798b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As another NixOS user, I don't get the point of devenv being used here?.
You don't have any containers, and you do have the LD_LIBRARY_PATH hacks and the --impure and the extra .devenv folder thing because of it
Like the only benefit over native flake devShells is sligtly better syntax in a couple of places maybe I guess?
I'm pretty sure you don't need the
watch_file
s unless devenv for some reason requires them?. Or maybe it's backwards compat for direnv versions that maybe didn't do that already for use_flake, okayAlso it's just a shell and not a full blown package, but I think I saw that you realise that and it's a bunch of work to get right as well and you already did infinitely more than I did anyway 😅
cb4798b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it does take care of Python shenanigans under the hood, be it pathing of Python itself and specifically to do with the virtual environment, which, in the previous iteration of the flake would require actions such as
rm -rf
ing the directory. devenv takes care of that. These reasons and devenv's usage across the Nix ecosystem are why I did opt for the change here. See my next statement for how--impure
will actually be able to be rid of, andLD_LIBRARY_PATH
is expected to be resolved throughlanguages.python.libraries
where devenv handles wrapping just thepython
binary.The
.envrc
is the recommended boilerplate from devenv, as seen here. It does seem like it has updated recently, actually to a stage where impure is no longer needed, so I will port that over in a moment here and see how things function, but is what I had used. I do see some differences though with the template from nix-direnv, so I will see about how that fares as well.The packaging will take a bit longer to do for TagStudio as there are numerous pip dependencies that are not in the
nixpkgs
repos. That being said, I have seen some projects usedevenv
for its extra Python packages, so I am looking into if that covers things (or at the very least less work).I hope that addresses your concerns.
cb4798b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, thanks, that clarified things
I never packaged any python stuff for nix so I might've overlooked things, it's sad that native nixpkgs packaging is still lacking (it seems?) in that regard