[Nix-dev] nix channels and nix expressions

Tony White tonywhite100 at googlemail.com
Tue Sep 22 20:14:05 CEST 2009


2009/9/21 Marco Maggesi <maggesi at math.unifi.it>:
> Hi Tony,
>
> On Sep 21, 2009, at 4:33 PM, Tony White wrote:
>
>> Hi Marco,
>> Can you say what package it is that is missing that you want to add to
>> nixpkgs?
>> One of the ways that you can add your own software to the nixpkgs, is
>> to create the expression for the software in the right folder among
>> the nixpkgs (Need to create a new one) And you could then add an entry
>> for your new expression to nixpkgs/top-level/all-packages.nix (I think
>> that's the right spelling.)
>
> Actually, this is more or less what I am trying to do, but I do not have
> the knowledge and the time to write expressions that match the nixpkgs
> conventions and quality standard, so I rather prefer to prepare my
> packages in in a separate tree and eventually propose to merge the result
> once I am satisfied with the result (which is not yet the case).
>
>> If you can say what it is you want to try to add to the nixpkgs, maybe
>> there is a reason why it's not there or it's tricky to build?
>> You are best off following the example in the manual and if you get
>> stuck anywhere, just post back and someone will try to point you in
>> the right direction.
>
> You can have an idea by looking at my nix expressions.  I just copied
> everything on the web:
>
> http://web.math.unifi.it/users/maggesi/nix/
>
> (in this moment, some packages are in an inconsistent state since
> I am working right now at my new setup).
>
> The starting point is the file my-expr.nix.  As you see, it imports the
> file all-package.nix from nixpkgs just at the top.
>
> I'm mostly interested in packaging theorem provers like Coq, HOL Light,
> Isabelle and related tools.
>
> I didn't make these packages public yet since several expressions are far
> from being polished (although some of them could be already good,
> e.g., camlp5, polyml, scsh).  Some other packages work but probably break
> the nixpkgs coding conventions (e.g.: hol-light, ocaml-with-srcs).
>
> I usually run these expressions on nixos, but sometimes I need to use
> other systems (mainly MacOSX and Ubuntu), so I would like to test and
> migrate these expressions there too.
>
> Hope that this explains what I am trying to do.
>
>> Is it an intel mac, just out of interest?
>
> Yes, Intel 32bit.
>
> Thanks,
> Marco
>
>

Hi Marco,
Yes, I think I understand what you are trying to do and nice work by
the way, you've obviously got the gist of creating expressions.
As far as standards go, the nix expression language is lazy by design,
so I don't think that there are too many standards to follow. I think
it's more like guidelines and if there is something very wrong or
there is a better way to do it I'm sure someone would just ask you and
suggest a better way to write the expression : If you wanted to commit
the packages to nixpkgs.
>From the few expressions of yours I looked at, they seem fine but it's
not for me to judge. :)
If you want to commit your expressions to nixpkgs then I guess you
just use svn to commit them but I've never done it and you would have
to ask (I think Eelco.)
I don't know if you can just commit against your email address or if
Eelco sets up an svn account first?

As far as modifying all-packages.nix goes without committing your
changes to the nixpkgs, just do it and then when you pull the latest
npkgs updates, if there is a conflict, svn will ask you : Yours or
theirs? So you'll get the option to drop or import the changes.
If your expressions do not exist in nixpkgs, then there generally
won't be anything you need to change when you pull a nixpkgs update.
I think that when you use svn on nixpkgs, the expressions you have
locally on your hard drive are patched against changes that the nix
developers have made and not completely overwritten. So you should be
safe to make modifications without the need to worry about constantly
recreating your expressions every time you pull nixpkgs.

I think using your own equivalent of all-packages.nix which is used
along with all-packages.nix must be possible but I've never done it. I
think it's way simpler just to use all-packages.nix.
Maybe someone else knows how to do what you want to do or how to
commit using svn?

Thanks,
Tony



More information about the nix-dev mailing list