[Nix-dev] NixON initiative

zimbatm zimbatm at zimbatm.com
Sun Feb 28 15:35:08 CET 2016


No, not the dead president :) JavaScript has JSON and Nix has NixON. A
subset of the language that only contains literal values.

Thanks to Tim Cuthbertson (@gfxmonk) nix-prefetch-git now outputs valid
NixON. Would it make sense to convert more of our tooling to using that
notation forward ?

The big advantage is that you can do something like:

```nix
{ stdenv, fetchFromGit }:
stdenv.mkDerivation {
  src = fetchFromGit (import ./repo.nix);
  ...
```

Then when upstream has an update it's very easy to write a script that
outputs that `repo.nix` file.
```
$ nix-prefetch-git git://github.com/direnv/direnv.git 2>/dev/null | tee
repo.nix
{
  url = "git://github.com/direnv/direnv.git";
  rev = "9283a67646349bfef002a7242db47a6b8ef75305";
  sha256 = "15kbzxwl03f0awnf5n6mw7hcz2dr7p6rpvhfyq3kxn1nk8jxcipx";
}
```

That's it really, I just wanted to throw that idea out there. Going forward
I think that having more of our tools emit nixon could be useful because it
ties all the ecosystem together.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160228/1d92c54e/attachment.html 


More information about the nix-dev mailing list