Re: [Nix-dev] NixON initiative

2016-03-19 Thread Ryan Trinkle
Hi everyone, These are great changes, but I would like to note that having a stable machine-readable output format for nix-prefetch-git would be very helpful. I frequently use that command in scripts, and the recent changes have caused some breakage. Of course, Nix makes that breakage pretty

Re: [Nix-dev] NixON initiative

2016-03-03 Thread Shea Levy
On 2016-03-03 19:34, Profpatsch wrote: > On 16-02-28 04:44pm, zimbatm wrote: >> So something like that ? https://github.com/NixOS/nixpkgs/pull/13552 >> And then we would convert all of our tooling to output JSON ? > > As long as nixexprs embedded in the JSON are *not* evaluated in any > way, > we

Re: [Nix-dev] NixON initiative

2016-03-03 Thread Profpatsch
On 16-02-28 04:44pm, zimbatm wrote: > So something like that ? https://github.com/NixOS/nixpkgs/pull/13552 > And then we would convert all of our tooling to output JSON ? As long as nixexprs embedded in the JSON are *not* evaluated in any way, we are fine. Think of { "hello" = "{ foo = (abort

Re: [Nix-dev] NixON initiative

2016-02-29 Thread zimbatm
@Eelco: that looks super cool, once it’s in we should implement all the nix-prefetch-* scripts in function of that. One difference is that nix-prefetch-git also resolves the git revision from a tag or branch name which makes it easy to generate an update script. @gfxmonk: heh not yet but

Re: [Nix-dev] NixON initiative

2016-02-29 Thread Herwig Hochleitner
2016-02-28 15:35 GMT+01:00 zimbatm : > No, not the dead president :) JavaScript has JSON and Nix has NixON. A > subset of the language that only contains literal values. > Cool Idea! Here is some code to translate NixON into edn (clojure's json,

Re: [Nix-dev] NixON initiative

2016-02-29 Thread Tim Cuthbertson
On Tue, Mar 1, 2016 at 12:40 AM, Eelco Dolstra wrote: > Hi, > > On 28/02/16 15:35, zimbatm wrote: > >> 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

Re: [Nix-dev] NixON initiative

2016-02-29 Thread Eelco Dolstra
Hi, On 28/02/16 15:35, zimbatm wrote: > 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

Re: [Nix-dev] NixON initiative

2016-02-29 Thread Tim Cuthbertson
Hah, well that has to be one of my shortest-lived changes ever. But as long as I can `fetchgit (importSomehow ./src.json)` I'll be happy, and it seems pretty useful to have nix understand JSON quite well anyway, since it's so pervasive. Thanks for publicising this, zimbatm :) Cheers, - Tim. On

Re: [Nix-dev] NixON initiative

2016-02-28 Thread zimbatm
Interesting how much traffic this thread has. If we have importJSON I suppose that we could then output JSON from all of our tooling. It should also make it easier to get the output from any modern language. In that case I will make some changes so that nix-prefetch-git outputs JSON by default

Re: [Nix-dev] NixON initiative

2016-02-28 Thread Moritz Ulrich
zimbatm writes: > ``` > $ 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 =

Re: [Nix-dev] NixON initiative

2016-02-28 Thread zimbatm
So something like that ? https://github.com/NixOS/nixpkgs/pull/13552 And then we would convert all of our tooling to output JSON ? On Sun, 28 Feb 2016 at 16:43 Anand Patil wrote: > You could interpret {path: "/a/b/c"} as a path literal. > > On Sun, Feb 28, 2016,

Re: [Nix-dev] NixON initiative

2016-02-28 Thread Anand Patil
You could interpret {path: "/a/b/c"} as a path literal. On Sun, Feb 28, 2016, 11:06 AM zimbatm wrote: > But we wouldn’t have the path type in JSON anymore ! Hmm maybe that’s a > good thing actually :p > > importJSON = path: builtins.fromJSON (builtins.readFile path); > > ​

Re: [Nix-dev] NixON initiative

2016-02-28 Thread Daniel Peebles
You mean you don't like naming it after everyone's favorite US president? :) > On Feb 28, 2016, at 09:54, deCube.net | Danny Wilson wrote: > > How about NEON > > Nix Expression Object Notation > >> On 28 feb. 2016, at 15:49, stewart mackenzie wrote: >>

Re: [Nix-dev] NixON initiative

2016-02-28 Thread yacine.hmito
bhakar.pa...@gmail.com> Cc: nix-dev <nix-dev@lists.science.uu.nl> Subject: Re: [Nix-dev] NixON initiative On Sun, Feb 28, 2016 at 03:11:15PM +, Anand Patil wrote: > What about using some kind of JSON notation for this? There are some > mismatches between JSON and Nix primitives; bu

Re: [Nix-dev] NixON initiative

2016-02-28 Thread jeaye
On Sun, Feb 28, 2016 at 03:11:15PM +, Anand Patil wrote: > What about using some kind of JSON notation for this? There are some > mismatches between JSON and Nix primitives; but on the other hand JSON is > easy to parse and generate from every language, and many people are > familiar with it.

Re: [Nix-dev] NixON initiative

2016-02-28 Thread Graham Christensen
> It should, most emphatically, that's the whole point! > > Stripping the Turing completeness with no remorse will open up a vast array > of options for data processing in the toolchain. > Yes, and what I meant is it would be very easy to start calling it NixON and start importing like

Re: [Nix-dev] NixON initiative

2016-02-28 Thread Anand Patil
What about using some kind of JSON notation for this? There are some mismatches between JSON and Nix primitives; but on the other hand JSON is easy to parse and generate from every language, and many people are familiar with it. On Sun, Feb 28, 2016, 9:54 AM deCube.net | Danny Wilson

Re: [Nix-dev] NixON initiative

2016-02-28 Thread Graham Christensen
I think it is a great idea for these functions to return valid nix expressions, and to be able to directly write them to a file. I also really like the idea of creating a named subset only containing literal values. However... I disagree about calling it something special other than just a

Re: [Nix-dev] NixON initiative

2016-02-28 Thread deCube.net | Danny Wilson
How about NEON Nix Expression Object Notation On 28 feb. 2016, at 15:49, stewart mackenzie wrote: > Excellent idea, this removes quite a lot of manual steps. > > Recently wrote some dirty python scripts to automate the checking and > replacing of sha256s, this approach

Re: [Nix-dev] NixON initiative

2016-02-28 Thread stewart mackenzie
Excellent idea, this removes quite a lot of manual steps. Recently wrote some dirty python scripts to automate the checking and replacing of sha256s, this approach would make it trivial, reducing check times from about an hour and growing to mere seconds. Though, I do have a reservation about

[Nix-dev] NixON initiative

2016-02-28 Thread zimbatm
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