[Nix-dev] Including binary-only derivation in nixops deploy.

Oliver Charles ollie at ocharles.org.uk
Fri Feb 12 12:54:34 CET 2016


If you're saying you want to install something knowing only the Nix store
path, you can do:

{ type = "derivation";
  name = "whatever";
  outputName = "out";
  outPath = builtins.storePath "/nix/store/deadbeefdeadbeef"; }

This will attempt to lookup the given store path in binary substitution
servers, and will fail if it can't be found (as Nix has no other way to
provide that output).

Does that help?


On Fri, Feb 12, 2016 at 3:03 AM Kevin Cox <kevincox at kevincox.ca> wrote:

> Hello all. I have a possibly strange question but I was hoping that you
> could help me out. I am currently using nixops to manage a couple of
> servers and have a couple custom derivations for personal packages. While
> managing the derivation in my nixops config isn't terrible I wanted to
> manage the derivations in each project so that I can use nix to build the
> project in CI and use nix-shell for development. Another benefit of using a
> binary is that I know that dependencies won't change, and that the package
> has been tested with the exact dependencies it will be shipping to
> production.
>
> So long story short I have uploaded the derivation to a binary cache and I
> was hoping to use it in a nixops deploy. However I can't figure out how to
> get it to work (if it is possible). `nix-store
> -r /nix/store/01kymbkb0a1sc99y72wzn5b4gcjdlbnm-dontsayit-nginx` works fine,
> the package and all of its dependencies are installed to the local store.
> However I can't figure out how to use it in a nixops config.
>
> The naive approach of just including the path in a file (in my case an
> nginx config) doesn't work as it isn't being scanned for that path and the
> dependency doesn't get picked up. Interpolating it as a path also doesn't
> work as the file gets copied from the store and put into the store under a
> different hash, losing all dependency information.
>
> I tried playing around with .drv descriptions but couldn't figure out how
> to get it to work either.
>
> I would appreciate any help or recommendations for alternative solutions.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160212/71e897ae/attachment-0001.html 


More information about the nix-dev mailing list