[Nix-dev] Software development workflow -- the nix way?

James Cook james.cook at utoronto.ca
Sat Aug 17 07:25:39 CEST 2013


On 15 August 2013 18:08, Kyle Heath <heathkh at gmail.com> wrote:
> Hi Nix Folks,
>
> short version:
>
> I would like to enable the following development workflow...
>
> 1. I write packages of code containing java, c++, python binary and library
> targets (and probably host them on github)
> 2. I include with each package a build script that will provide all it's
> dependencies via nix packages - (either from the official nix repository or
> from my own public repository of nix packages)

its

> 3. I can release source and binary versions of my packages by tagging them
> on github and publishing them to my own nix channel.  After publishing them,
> anyone can depend on them from other packages based on the same build script
> system.
>
> Has anyone done something like this or have ideas if this could be done?
>
> long version:
>
> I'm a graduate student, and write lots of code that I'd love to share with
> the world.  I'm learning the hard way that publishing source is easy for the
> developer, but hard for potential users while publishing (a matrix) of
> binary versions makes it easy for potential users but really hard for the
> developer.  I started packaging my code with zeroinstall, but quickly found
> that binary portability is hard to pull off and package dependency
> resolution based on ad-hoc version numbers is not good enough to reliably
> build software from source.  I read the nix papers and documentation and was
> very excited about the generality of this approach.   I would love to figure
> out if nix can be part of a cross-language cross-platform workflow that
> eliminates the dependency hell problem.
>
> Cheers,
> Kyle

(a) The most common way of getting Nix to build something is to check
out the nixpkgs repository and add an expression for your package to
it.  Once your package is in the official repository, I think making a
bootstrap script to install nix and then ask nix to install your
package should be straightforward.

(b) I get the impression you're asking for something less centralized
though.  If you don't want to rely on the official nixpkgs repository
accepting your pull requests, then things get more interesting.  I
think it is still do-able, but would require more work.

I have some ideas for (b) but they're half-baked and I'm curious to
hear what others have to say.

In any case, I would start with (a), since it's pretty much a
pre-requisite for (b).

James


More information about the nix-dev mailing list