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)
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. Files from this session: https://github.com/tweag/nix-hour/tree/master/34 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 File sets links: Discourse post: https://discourse.nixos.org/t/easy-source-filtering-with-file-sets/29117/3 Rendered documentation: https://tweag.github.io/nixpkgs/file-sets/manual.html#sec-functions-library-fileset 00:00 Intro, no Nix Hour for the next 2 weeks 00:54 Q: what is the difference between using python.pkgs and python.withPackages 01:51 nix-shell and python3Packages 02:55 nix-shell and withPackages 03:32 venv usage works with withPackages, but not with python3Packages 04:39 Looking at PYTHONPATH with both variants 06:15 makeBinaryWrapper 09:58 difference between buildInputs and python.withPackages 10:52 buildInputs can poison derivation environment with setup-hook 12:19 python3.withPackages only provides one binary instead 13:07 Recommend using buildPythonPackage when possible 14:36 File sets: why, what and how. 15:25 Current state of things: using ./. as src for derivation 19:25 Comparing resulting derivations and their srcs 22:22 Flakes don't have this particular issue, replicating that behavior with fetchGit 25:27 Still not ideal: any change to git repo triggers rebuild 26:19 Excluding files from the src with builtins.path 31:58 Paths and strings in Nix are never equal 32:51 Filtering out object files 34:22 Filter always recurses into subdirectories 27:47 Including only one subdirectory 39:25 File sets overview 41:15 Functions: union 41:35 Functions: trace 42:49 Functions: difference 43:50 Functions: fileFilter 45:06 Functions: intersect 45:25 Nothing is imported into Nix store 47:17 Functions: toSource 49:22 Switching to file sets in our example, "unions" function 56:00 File sets overview summary 59:06 Outro, see you in 3 weeks