[Nix-dev] A few questions from a NixOS newbie.

Kirill Elagin kirelagin at gmail.com
Mon Apr 21 17:01:02 CEST 2014


Just rebooted.

kirrun at kirPC ~ [1001]% time nix-env -qa > /dev/null
nix-env -qa > /dev/null  1,66s user 0,49s system 7% cpu 29,789 total
kirrun at kirPC ~ [1003]% time nix-env -qa >| /dev/null
nix-env -qa >| /dev/null  1,42s user 0,28s system 99% cpu 1,706 total

30 seconds just to list available packages. I guess, then files got
buffered and things become better.
Well that's comparable to eix except that when you are looking for a
specific package it is not necessary to go through _all_ of them. That's
where eix is good (hashes) and nix-env is as slow as when you list all the
packages.


--
Кирилл Елагин


On Mon, Apr 21, 2014 at 6:53 PM, Mateusz Kowalczyk
<fuuzetsu at fuuzetsu.co.uk>wrote:

> On 04/21/2014 04:34 PM, Kirill Elagin wrote:
> > Right, pretty cool, but still needs a sane frontend. I mean, JSON is way
> > better than, say, XML, but…
> > And the problem with nix-env is that it's damn slow (not as slow as
> > `emerge` of course, but way slower than `eix`).
> >
> > I was going to write something like `eix` for Nix but unfortunately I
> don't
> > have enough time. It would be great is someone did this.
> >
>
> I admit that I thought about this but I could not justify the effort for
> the time saved. If anything, simply parsing the json output presented in
> previous e-mail could provide a fair front-end.
>
> Is nix-env slow enough to justify eix-like thing? I can't tell after a
> day of using nix but emerge is also pretty fast on day 1 ;).
>
> > --
> > Кирилл Елагин
> >
> >
> > On Mon, Apr 21, 2014 at 6:25 PM, Bjørn Forsman <bjorn.forsman at gmail.com
> >wrote:
> >
> >> On 21 April 2014 15:35, Kirill Elagin <kirelagin at gmail.com> wrote:
> >>> If there was a way to
> >>>
> >>> 1. run nix-repl non-interactively,
> >>> 2. list variables in scope
> >>>
> >>> that would be a fine replacement for grepping and opening files…
> >>>
> >>> Something like `nix-repl ':l <nixpkgs>; :scope' | grep foo` and
> `nix-repl
> >>> ':l <nixpkgs>; :p foo.meta`.
> >>
> >> Running nix-repl non-interactively:
> >>
> >> $ printf ":l <nixpkgs>\n:p wireshark.meta" | nix-repl
> >> Welcome to Nix version 1.7. Type :? for help.
> >>
> >> nix-repl> :l <nixpkgs>
> >> Added 3747 variables.
> >>
> >> nix-repl> :p wireshark.meta
> >> { description = "a powerful network protocol analyzer"; homepage =
> >> "http://www.wireshark.org/"; license = { fullName = "GNU General
> >> Public License version 2"; shortName = "GPLv2"; url =
> >> "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html"; };
> >> longDescription = "Wireshark (formerly known as \"Ethereal\") is a
> >> powerful network\nprotocol analyzer developed by an international team
> >> of networking\nexperts. It runs on UNIX, OS X and Windows.\n";
> >> maintainers = [ "Peter Simons <simons at cryp.to>" ]; platforms = [
> >> "i686-linux" "x86_64-linux" "armv5tel-linux" "armv7l-linux"
> >> "mips64el-linux" ]; position =
> >>
> >>
> "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/applications/networking/sniffers/wireshark/default.nix:47";
> >> }
> >>
> >>
> >> It's not as user friendly as e.g. "apt-get show wireshark" on
> >> Debian/Ubuntu :-)
> >>
> >>
> >> Hm, I just tested the new --json option for nix-env. Look at this
> >> (plesently surprised):
> >>
> >> $ nix-env -qaP --json wireshark | json_pp
> >> {
> >>    "nixos.pkgs.wireshark" : {
> >>       "system" : "x86_64-linux",
> >>       "name" : "wireshark-1.11.2",
> >>       "meta" : {
> >>          "longDescription" : "Wireshark (formerly known as
> >> \"Ethereal\") is a powerful network\nprotocol analyzer developed by an
> >> international team of networking\nexperts. It runs on UNIX, OS X and
> >> Windows.\n",
> >>          "homepage" : "http://www.wireshark.org/",
> >>          "platforms" : [
> >>             "i686-linux",
> >>             "x86_64-linux",
> >>             "armv5tel-linux",
> >>             "armv7l-linux",
> >>             "mips64el-linux"
> >>          ],
> >>          "maintainers" : [
> >>             "Peter Simons <simons at cryp.to>"
> >>          ],
> >>          "position" :
> >>
> >>
> "/nix/store/sv3pqp26qkiviq0rk2dgpaj6a1csaf3a-nixos-14.04pre42244.4160e65/nixos/nixpkgs/pkgs/applications/networking/sniffers/wireshark/default.nix:47",
> >>          "license" : {
> >>             "fullName" : "GNU General Public License version 2",
> >>             "url" : "
> http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
> >> ",
> >>             "shortName" : "GPLv2"
> >>          },
> >>          "description" : "a powerful network protocol analyzer"
> >>       }
> >>    }
> >> }
> >>
> >
>
>
> --
> Mateusz K.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140421/0242b215/attachment.html 


More information about the nix-dev mailing list