Nix-shell shebangs are really handy.
Today, I needed to write a quick and dirty Python script to do some web page parsing and regexery, so just popped in python311 and python311Packages.
No pyproject.toml, no containers, no Docker, no venv. Run it, use result, then Nix's garbage collector will throwaway the dependencies when we're done.
Also 24 lines of Python with httpx and bs4 that took about 20 minutes just saved me multiple hours of time-consuming work.
@tommorris Hey Tom, do you happen to know a good getting started guide for Nix/NixOS written for mere mortals? I really feel I should be using Nix but every time I look into I get frustrated trying to set up a working system and leave it at that.
@destructatron @tommorris Thanks for the offer. I more wanted to evaluate it as a basis for the deployment of Small Web servers so I was trying to grok how it worked and there’s a huge learning curve. I was just trying to get a taste for it to see if it would be right to base this system I’m building on but it feels a bit too much like Arch Linux in its culture (at least from the outside) and I’m just not smart enough for such things :)
@aral@mastodon.ar.al @destructatron@masto.destructatron.net @tommorris@mastodon.social i have to say, the learning curve for the sort of approach you're talking about is somewhat steep. You're not just having to configure NixOS as a system, but to get the real advantage of it you'd want to package your software for Nix first, and have them be configurable through user's NixOS configs like services.kitten.enable = true;
ect.
I found these tutorials to really clear things up when it comes to packaging for Nix:
- https://youtu.be/IrxCiNnXG4M
- https://youtu.be/FFuBCgsLPlw
I've been wanting to draw the content out into a written piece but haven't had the time yet.
@scott @destructatron @tommorris Thank you. And yes, this is very much along the lines of what I’d need to do. I actually think, for my needs, something like CoreOS set to auto-update might be better. But good luck finding inexpensive and reliable VPS hosting for either :)
@aral@mastodon.ar.al @destructatron@masto.destructatron.net @tommorris@mastodon.social I have recently deployed a NixOS server on Hetzner, using the ISO instructions here https://nixos.wiki/wiki/Install_NixOS_on_Hetzner_Cloud#From_NixOS_minimal_ISO
@scott @destructatron @tommorris Thanks again :)