3 ms·
I learned about this very recently[1] and it seems like an amazing use case that I wish got more play in the marketing of Nix. I have a lot of dumb "productivit
by ianthehenry 6y ago
I learned about this very recently[1] and it seems like an amazing use case that I wish got more play in the marketing of Nix. I have a lot of dumb "productivity" scripts that I wrote at work (Linux) that I can't run at home (macOS) because of differences in the behavior of `find` or `date` whatever. I plan on porting them to use `nixpkgs.findutils` etc. and never having to worry about this again.
[1]: https://ianthehenry.com/posts/how-to-learn-nix/command-reference/ https://ianthehenry.com/posts/how-to-learn-nix/command-refer...
- rchoudhury 6y agoOh my goodness, your blog series looks incredible. I'm in sort of the same boat as you--I've been barely treading water with NixOS for the last several years and have recently resolved to learn how it works well enough to get all the benefits. Thanks for putting this together; looking forward to diving into it!
- siraben 6y agoNeat! In your post you mention that it takes a few seconds until you get to the prompt (and the waiting time is similar for the nix-shell shebang scripts), but recently someone made nix-script[0] to cache these scripts, resulting in a runtime on the order of dozens of milliseconds. Also, thanks for being dedicated enough to read the entire manual and give your impressions! If you spot typos, things that could be clearer, etc. please let us know on Freenode #nixos-dev or the Nixpkgs issue tracker! Do you also plan on covering flakes? Flakes are currently gaining adopting in the Nix ecosystem and are pretty exciting, since they resolve issues like ad-hoc project structuring, and since evaluation will now be pure, results can be cached aggressively and nix-shell will be much much faster. [0] https://bytes.zone/posts/nix-script/ https://bytes.zone/posts/nix-script/
- ianthehenry 6y agonix-script looks awesome -- I saw that post on HN right after I started learning Nix, and it's sitting in my notes as something to go back to later in the series (I'm trying not to jump around too much until I'm done reading the official docs, to try not to taint myself with too much knowledge). I used to work somewhere that had built something like this specifically for OCaml scripts, so it's very cool to see a generic solution. I have encountered flakes in passing -- in the as yet unpublished part 20 I built Nix from source to try to fix a bug I found, and encountered the concept briefly. This series is on my reading list once I've read the Nixpkgs manual and Nix Pills: https://www.tweag.io/blog/2020-05-25-flakes/ https://www.tweag.io/blog/2020-05-25-flakes/ (Not sure if there's a better place to start.) I plan on opening some doc PRs once I'm done reading through everything -- I found a few little things that I feel like I can fix myself. For higher level issues I'll try to open a discussion (e.g. I had a lot of trouble going through section 14.3 and 15.4 of the Nix manual). Anyway. Kind of off-topic for this thread, but here we are.