Re: [Nix-dev] Using Nix as a package manager (for yet another language)

2016-02-12 Thread Marc Weber
urweb requires C/C++ libraries (eventually).
AFAIK C/C++ package managers don't exist (dependency information) - they
are "encoded in configure scripts and whatnot" - for some universes
(gnome) there are dependency informations available eventually.

Thus for that use case nix is a good fit, because you can "provide a
working set of dependencies" within nixpkgs - and because nix also
forces you to have "one maintained set of packages". Eg hackage
theoretically allows infinite amount of combinations nobody can test in
real life.

All languages I know (Haskell, python, ruby) depend on C libraries and
thus partially suffer from such kind of problem - even Vim depending on
python and whatnot...

Thus yes: Nix is likely to provide results you can live with fast.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Using Nix as a package manager (for yet another language)

2016-02-12 Thread Sergey Mironov
Hi, List. I've just noticed a long topic regarding using NIx as a
package manager for a language. Сoincidentally, I use Nix for the same
purpose: I am working on packaging UrWeb libraries using Nix.

Here is the combinators library I wrote
[1] - https://github.com/grwlf/urweb-build/blob/master/default.nix
Here is an example of package recipe script
[2] - https://github.com/grwlf/urweb-soup/blob/master/build.nix

Nix-build works fine as a replacement for GNU Make. But here comes an
interesting question. What if I want to package a Nix-driven library
for NixOS ?? I don't know how to do it at the moment.

The problem is at the line 7 of [1]: I import  here.
Packaging this 'build-script' for NixOS means running nix-build from
the builder of mkDerivation, in pure environment where we do not have
NIX_PATH (am I right?). And AFAIK it is a top of an iceberg.

So what do you think, how to call nix-build from the mkDerivation's
build script and make it aware of the same Nixpkgs tree the top-level
nix-build (which runs current mkDerivation) uses?

Regards,
Sergey
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Using Nix as a package manager (for yet another language)

2016-02-12 Thread stewart mackenzie
If you don't mind I'll use this thread as the umbrella "nix as yet
another language package manager" issue thread.

I want to do this:

create a derivation that creates a shell file.
This shell file does one thing and one thing only: it creates a custom
virtual machine depending on the inputs of the flow-based programming
file.
(later I'll implement a recursive decent function which determines the
transitive deps of a flow-based programming file.

This fbp file consists of exactly two dependencies:
'maths_boolean:(boolean="true"' -> a nand(maths_boolean_nand) output
-> input disp(maths_boolean_print)
'maths_boolean:(boolean="true"' -> b nand()

1) maths_boolean_nand :
https://github.com/sjmackenzie/fractalide/tree/fractalide/components/maths/boolean/nand
2) maths_boolean_print :
https://github.com/sjmackenzie/fractalide/tree/fractalide/components/maths/boolean/print

Both of these libraries are shared libraries programmed in the Rust
programming language.


I need to ensure the below user experience:

$ git clone git://github.com/sjmackenzie/fractalide (fractalide branch)
$ nix-build  -> creates a sh file, and copies a snapshot
of the current state of the fractalide codebase to /nix/store/
$ ./result/bin/fvm ~/path/to/fbp/file.subnet---> pass the
fbp file to the sh script, the sh script compiles a custom virtual
machine with all the deps then
immediately executes the subnet

If the fvm is installed via
$ nix-env -iA nixos.fvm

whenever one runs
$ fvm ~/path/to/fvm.fbp (where the *.fbp has continuously changing
contents, a new fvm with exactly those deps are compiled, symlinked
then executed.)

This is what I have... and it sucks batshit:
The problem lies here:
https://github.com/sjmackenzie/fractalide/blob/fractalide/default.nix#L21

What am I doing wrong?

This approach allows fvm to be lazily evaluated, thus allowing the
repo to expand massively (similarly to nixpkgs) without having to
compile everything up front.
This is an extremely desirable feature, as rust compilation times are
cause for suicide.

>From a higher level: does anyone have a better suggestion on
approaching this kind of system? The we're all trail blazing and it
would be good to head bang.

/sjm
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev