4 ms·
As colemickens mentioned, fetchTarball works pretty well. I have an expression that fetches a specific version of nixpkgs, imports it, and instantiates it with
by cwp 7y ago
As colemickens mentioned, fetchTarball works pretty well. I have an expression that fetches a specific version of nixpkgs, imports it, and instantiates it with an overlay. That lets me override certain packages to customize them or use a different version than nixpkgs provides, and also to add my own packages.
I periodically update the version of nixpkgs it uses, but since it's pinned, I get exactly the same outputs when building.
- tbenst 7y agoAh do you use fetchTarball for nixpkgs? Although maybe I’m not understanding how you’re using it, could you share an example? Interested in your workflow!
- cwp 7y agoYes, I use fetchTarball to get the pinned version of nixpgs. Like this: let nixpkgs = builtins.fetchTarball { name = "nixpkgs-upstream"; url = https://github.com/NixOS/nixpkgs/archive/a835adc10cb813d214a9069361d94a2a3f8eb3a5.tar.gz; sha256 = "0h4lacvqmk356ihc7gnb44dni6m5qza23vlgl6w6jdhr9pjcmdcm"; }; overlay = self: super: { # customizations }; in import nixpkgs { overlays = [ overlay ]; } This isn't even simplified. I just cut out the contents of the overlay. For more on how overlays work take a look at these references; they were really helpful to get me started. https://nixos.org/nixpkgs/manual/#chap-overlays https://nixos.org/nixpkgs/manual/#chap-overlays https://blog.flyingcircus.io/2017/11/07/nixos-the-dos-and-donts-of-nixpkgs-overlays/ https://blog.flyingcircus.io/2017/11/07/nixos-the-dos-and-do...