Closed philip-wernersbach closed 5 years ago
I'll also add that this leads to awkward/political questions like "if Nix is so great, why are we still using Make?" It's hard to explain this while still convincing them that Nix is the way to go.
There's the following option, although perhaps not very bandwidth-efficient:
NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
(or you can pass it via -I nixpkgs=...
)
Can you override the derivations you need? The src attribute accepts a path, you can also override mkDerivation to suit your needs.
Sounds like you should also be using hydra? There is also https://github.com/shlevy/nix-exec, which does some fairly clever cached fetching, @shlevy can explain more.
Yes, this kind of thing was one of the main use cases motivating nix-exec. In addition to built-in git fetching as a primitive action, it is overall designed so that nix-exec
is the only tool you should need installed to accomplish whatever build/deployment setup you're aiming for.
Closing, this particular use case is addressed by flakes.
I don't think we should be closing issues addressed by flakes until flakes are merged? Better to make the commit "closing #..." on that branch so they are closed automatically on merge.
We're using Nix, NixOS, and NixOps at work for development and testing of our software applications. The issue with this is that our use case requires that the Nix expressions for our applications always use our git HEAD as a source base. It is infeasible to expect our developers to update our Nix expressions by hand every time they update HEAD, and Nix has no way to preprocess and insert our HEAD revision into the Nix expressions on-the-fly.
We've had to settle for using Make as a preprocessor for our Nix expressions. So our developers run make, which will update our Nix expressions to the HEAD revision, and then they can install the Nix expression using the standard Nix utilities. This feels like a huge hack: Nix is a great and full featured language, but we have to fall back to using a different language for actually preparing Nix. It also pulls in a dependency on make that we could otherwise avoid.