Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Description
I want to usenix-shell shebangs in my personal script collection to make sure all the needed dependencies are available. That has two disadvantages however:
- it adds significant overhead (~half a second on my machine if all dependencies are already present)
- dependencies may be garbage collected so usage of scripts may need internet access
So what I'd actually like is nix-shell like dependency declaration that is resolved statically whenever I update my channels. I've hacked together a proof of concept to do this in home-manager: I iterate through all my scripts, parse the nix-shell shebang line and generate a wrapper script that setsPATH. It is very hacky at the moment and I'm not sure yet if I will improve it in the future, but I thought it couldn't hurt to share it here. What do you think about including something similar as ahome-manager library function?
Here is my POC which I import in myhome.nix.