[Nix-dev] Some beginner Nix/nixpkgs questions
Alex Dean
alex at snowplowanalytics.com
Wed Aug 5 12:33:26 CEST 2015
Thanks Luca,
On 1 - "We prefer having only the latest version when possible.". I don't
think I understand this. If I am using Packer to build an Amazon AMI and
install Kafka via Nix, then all it takes is a single commit to Nixpkgs for
me to end up with a different Kafka version on an image built on Tuesday to
an image built on Monday. I understand the concept of "always deploy the
latest XXX available", but the presumption of it is unworkable from a
devops perspective.
On 2 - I will give that a try, thanks.
On 3 - fetchgitPrivate looks like a way of building a package from a
private repo. I am interested in hosting a private "instance" of Nixpkgs
with some private packages and adding that into my list of Nix package
resolvers - does that make sense?
Thanks,
Alex
On Wed, Aug 5, 2015 at 11:13 AM, Luca Bruno <lethalman88 at gmail.com> wrote:
> On 05/08/2015 12:05, Alex Dean wrote:
> > Hi,
> >
> > I’m currently evaluating Nix (the package manager) for use at Snowplow
> > - I really like what I see but I have some questions, particularly
> > around private artifacts and package repositories.
> >
> > As a bit of background, our primary goal in adopting Nix would be to
> > move a lot of bespoke app/data installation logic currently in Ansible
> > into Nix.
> >
> > Questions as follows:
> >
> > 1. I am a little confused by the role of Nixpkgs. If we take e.g.:
> >
> > https://github.com/NixOS/nixpkgs/tree/master/pkgs/servers/apache-kafka
> >
> > Nixpkgs seems to offer only a single version of Kafka. What if I want
> > to install other versions of Kafka? It feels like the hierarchy is
> > Nixpkgs -> package-some-version, rather than Nixpkgs -> package ->
> > version. What am I missing?
> You can just package your own version. Evidently people is not
> interested in maintaining older versions. We prefer having only the
> latest version when possible.
>
> E.g. if you check postgresql, we have lots of versions in nixpkgs.
>
> >
> > 2. Is there a way to fetchurl with authentication? I’m looking to
> > reproduce this (Ansible):
> >
> > - name: Install {{ binary }} | Download {{ binary }} into staging
> > directory
> > get_url: url="{{ binaries[binary]['download_url'] }}/{{
> > binaries[binary]['download_file_name'] }}"
> > dest={{ download_location }}
> > url_username={{ bintray_username }}
> > url_password={{ bintray_api_key }}
> > sudo: yes
> Private stuff with authentication in nix is tricky, but doable. You
> should be able to set NIX_CURL_FLAGS when using fetchurl, which is an
> impure variable that is passed through the derivation. There you should
> be able to set http auth with curl options.
> >
> > 3. How do I operate a private repository of packages? I’ve seen this
> > blog post:
> >
> >
> http://sandervanderburg.blogspot.co.uk/2014/07/managing-private-nix-packages-outside.html
> >
> > But this seems to refer to private packages on the local filesystem.
> > How do I run a centralized but private repository of packages that
> > 100s of machines can download from?
> Check fetchgitPrivate, that might help.
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
--
Co-founder
Snowplow Analytics <http://snowplowanalytics.com/>
The Roma Building, 32-38 Scrutton Street, London EC2A 4RQ, United Kingdom
+44 (0)203 589 6116
+44 7881 622 925
@alexcrdean <https://twitter.com/alexcrdean>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150805/fbc584d8/attachment.html
More information about the nix-dev
mailing list