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

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Mon Apr 21 16:53:16 CEST 2014


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.


More information about the nix-dev mailing list