The Nix Hour is a weekly beginner-oriented improvised QA-style lecture on Nix, hosted by Tweag. Here you can bring your questions and we'll answer them with more context, examples, alternatives, tradeoffs and related topics. These meetings are open for anybody to join, but also recorded and uploaded to the Tweag YouTube channel. For more information check out https://discourse.nixos.org/t/the-nix-hour-a-weekly-nix-qa-lecture-by-tweag/22767
Curated by: Tweag by Modus Create (81 videos)
Due to technical problems we couldn't live stream this week, so instead this is a local recording uploaded afterwards. The Nix Hour is an open beginner-oriented Q&A-style lecture on Nix, where you can bring your questions and we’ll answer them with more context, examples, alternatives, tradeoffs and related topics. Jitsi Meeting to ask questions directly: https://meet.jit.si/nix-hour Matrix room for questions, feedback and notifications: https://matrix.to/#/%23nix-hour:matrix.org Issue tracker for asynchronous questions: https://github.com/tweag/nix-hour/issues Previous sessions playlist: https://www.youtube.com/playlist?list=PLyzwHTVJlRc8yjlx4VR4LU5A5O44og9in For more information and updates, check out https://discourse.nixos.org/t/the-nix-hour-a-weekly-nix-qa-lecture-by-tweag/22767 00:00 Intro 00:34 GitHub issue: How to package shell scripts 01:15 Packaging a simple shell script with runCommand 03:27 Using patchShebangs to fix refernce to Bash in shebang 04:28 Providing tools in PATH with makeWrapper 07:28 Binaries are not always in default output 08:00 Aside: querying nixpkgs using Nix language 11:28 Making sure to use output with binaries with getBin 13:34 Using makeBinPath to generate PATH 15:55 Switching to wrapProgram to wrap script in place 20:13 Finding the source of self-referential result 21:01 Making PATH "pure" by overwriting it in the wrapper 22:44 Falling back on hardcoded binaries 23:38 Trying out resholve to sub binary paths in the script 32:07 Checking out resholve documentation 35:28 Switch to resholve.writeScriptBin 38:40 Manually resolving tool paths in the script 41:09 Looking at resholve Nix API implementation 42:39 Checking out nixpkgs writers for various languages 44:03 Inlining values from Nix into the script using substitute and substituteInPlace 49:50 Signoff