Re: [Nix-dev] Nix-dev mailing list is moving

2017-07-12 Thread Roni Choudhury via nix-dev
Thanks for the announcement.

When do we plan to stop using this list? I want to make sure I am receiving
messages on the new list, so some type of test message in the near future
would be appreciated :)

roni

On Wed, Jul 12, 2017 at 8:15 AM Eelco Dolstra via nix-dev <
nix-dev@lists.science.uu.nl> wrote:

> Hi all,
>
> This mailing list is shutting down soon. Thanks to the Faculty of Science
> at
> Utrecht University for hosting it for many years. However, the large
> number of
> subscribers was causing issues, so it's time to move it.
>
> I've created a replacement mailing list:
>
>   nix-de...@googlegroups.com
>
> Note: that's *nix-devel*, not nix-dev. That name was already taken by
> another
> project.
>
> You can subscribe and browse the archive by visiting
>
>   https://groups.google.com/forum/#!forum/nix-devel
>
> If you don't have a Google account, you can subscribe by visiting
>
>   https://groups.google.com/group/nix-devel/subscribe
>
> or by sending an empty mail to nix-devel+subscr...@googlegroups.com.
>
> Please let me know if you encounter any issues!
>
> --
> Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] conflicting packages / priority values

2017-06-16 Thread Roni Choudhury
>From time to time I see an error message like this:

collision between
‘/nix/store/qs8fq5ld2shc0i3fvbs6n0g0k8fypndm-git-2.13.0/bin/git’ and
‘/nix/store/64fjdb4whkf2r5x8xyqf9kkljnk6w59b-git-2.13.0/bin/git’; use
‘nix-env --set-flag priority NUMBER PKGNAME’ to change the priority of
one of the conflicting packages

I understand what causes it (two packages competing to place the same,
e.g., binaries in my profile), but I’ve never understood how to resolve it.
Usually I just guess priority numbers until it works; more lately I’ve
simply removed the offending package from my environment before repeating
the failing install command. Obviously, neither approach is healthy or
correct :)

The man page for nix-env contains the following:

If there are multiple derivations matching a name in args that have the
same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the
highest priority is used. A derivation can define a priority by declaring
the meta.priority attribute. This attribute should be a number, with a
higher value denoting a lower priority. The default priority is 0.

But I’m still not sure what this means for my error situation. How do I
know what the priorities are for the different packages? The default value
is 0, which is the highest priority; what does that mean exactly, for the
default priority to be the highest priority?

Is there a more intuitive way to resolve this sort of conflict? For
instance, is there a way to tell nix-env to force the issue by treating the
requested package as higher priority than any existing ones?

Thanks!

roni
​
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] weird garbage output inside nix-shell

2017-06-14 Thread Roni Choudhury
I use the plain old terminal vim, but you inspired me to start probing
whether one of those libraries was specifically causing the problem.

It turns out to be `glibc` that was causing the trouble. I have no idea why
I thought I needed glibc in my nix-shell environment but there you go. If I
omit that one line from my `shell.nix` then everything seems to work ok.

Sergiu, thanks again for engaging with me and diving into this issue, it's
much appreciated!

roni

On Wed, Jun 14, 2017 at 4:58 PM Sergiu Ivanov  wrote:

> Hey Roni,
>
> Thus quoth  Roni Choudhury  at 20:55 on Tue, Jun 13 2017:
> > On Sun, Jun 11, 2017 at 5:45 AM Sergiu Ivanov siva...@colimite.fr
> > <http://mailto:siva...@colimite.fr> wrote:
> > Thus quoth  Roni Choudhury  at 17:38 on Sat, Jun 10 2017:
> >>
> > Definitely weird then - is there some way to probe exactly what packages
> > are in my nix-shell environment? Do I do that just by following symlinks
> > eventually into the store?
>
> There are probably some more intelligent ways of doing that, but I don't
> know of them :-(
>
> >> If I send my shell.nix, would someone else mind trying to use it to see
> if
> >> > you can reproduce my strange results?
> >>
> >> Go ahead.  (Remember to scrub all sensitive information.)
> >>
> > Thank you. I’ve attached my shell.nix file to this message.
>
> I have no trouble running vim inside the environment provided by your
> shell.nix.  I get no extra messages.
>
> However, when I try running termite, gedit, or gimp, I get error
> messages similar to yours.  I suppose your vim command launches gvim,
> which uses GTK, just like gedit and gimp.  Note that I don't have issues
> with qutebrowser, which does not use GTK.
>
> > I did discover that I can “fix” my shell problems by omitting this line
> > from shell.nix:
> >
> > LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath libs;
> >
> > Without that line, my LD_LIBRARY_PATH env var just has
> > /run/opengl-driver/lib in it, and vim works as expected. I’m not sure
> why I
> > did this, because my build seems to work without it.
>
> Omitting this line fixes the issues on my machine as well.  Moreover, if
> I take your original shell.nix (with redefined LD_LIBRARY_PATH), run
> nix-shell and manually set LD_LIBRARY_PATH to /run/opengl-driver/lib, or
> even to the _empty string_, things work as expected.
>
> > This may explain why my ldd output differs inside and outside my
> > nix-shell environment.
>
> I didn't observe any differences for any of the applications I tried,
> but I didn't look really hard.
>
> > So I guess my next question is: if I did want to put those packages’
> > libraries into my library loader path, how am I supposed to do it? I
> tried
> > this:
> >
> > LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${stdenv.lib.makeLibraryPath libs}";
> >
> > but that doesn’t work for, perhaps, obvious reasons.
>
> One way of doing this would be just moving that line into shellHook
> (mind the spaces around the equals sign):
>
>   shellHook = ''
> LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${stdenv.lib.makeLibraryPath libs}"
> echo "Candela nix dev environment"
>   '';
>
> The way you tried it originally doesn't work because, apparently, Nix
> does not apply shell variable expansion.
>
> If you tried writing something like this, outside of shellHook,
>
>   LD_LIBRARY_PATH = "${LD_LIBRARY_PATH}:${stdenv.lib.makeLibraryPath lib}";
>
> you probably saw that LD_LIBRARY_PATH is undefined.  I think that's
> because the environment variable LD_LIBRARY_PATH is not defined (or is
> not accessible via a Nix variable) at this stage of evaluation of
> shell.nix (that's a belief I inferred by observation; that is, I don't
> know for sure).
>
>
> Now, if I try launching GTK applications from within the shell.nix
> modified in this way, I get the same error message.  That may probably
> be due to the fact that my GTK applications were built against GTK 3,
> while you shell.nix requests GTK 2 (that's a guess, again).
>
> --
> Sergiu
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] weird garbage output inside nix-shell

2017-06-13 Thread Roni Choudhury
On Sun, Jun 11, 2017 at 5:45 AM Sergiu Ivanov siva...@colimite.fr
<http://mailto:siva...@colimite.fr> wrote:

Thus quoth  Roni Choudhury  at 17:38 on Sat, Jun 10 2017:
> >
> > Linus, Sam, and Sergiu - thank you for the suggestions. I did poke
> > around in the output from `env` and discovered IN_NIX_SHELL, and
> > arranged my .zshrc to show `${name}` when `$IN_NIX_SHELL` is
> > true. Fantastic!
>
> Great job!  I didn't know about that environment variable.
>
I think it should be called NIX_IN_SHELL but IN_NIX_SHELL is good too :).

> I'm not sure the other problem has to do with character encodings
> > (though I don't know too much about how that works).
>
> Ooh, sorry, I messed up in my previous E-mail by saying "ASCII terminal
> codes" :-( What I really meant was this:
>
>   https://en.wikipedia.org/wiki/ANSI_escape_code

Ah ok. Well, I use terminal colors in my zsh setup so I can’t imagine it’s
a misinterpreted escape code…

> I did notice that `ldd $(which vim)` shows me different results when I
> > am inside my nix-shell vs. when I'm not.
>
> This is weird.  I get exactly the same results (modulo the differences
> in the memory map addresses listed in parentheses at the end of each
> line).  (I don't have vim mentioned in this particular shell.nix.)
>
Definitely weird then - is there some way to probe exactly what packages
are in my nix-shell environment? Do I do that just by following symlinks
eventually into the store?

> I kind of thought I shouldn't even be able to launch vim from inside
> > my shell if it's not listed as a buildDep.
>
> It looks to me that nix-shell _extends_ the environment it is run in.
> So, if you run nix-shell in an environment which contains vim, you have
> vim inside nix-shell.
>
Right, my mistake. Then I’m starting to think it’s that weird shifting of
dynamic libraries that’s causing my shell trouble. In fact, see below…

> If I send my shell.nix, would someone else mind trying to use it to see if
> > you can reproduce my strange results?
>
> Go ahead.  (Remember to scrub all sensitive information.)
>
Thank you. I’ve attached my shell.nix file to this message.

I did discover that I can “fix” my shell problems by omitting this line
from shell.nix:

LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath libs;

Without that line, my LD_LIBRARY_PATH env var just has
/run/opengl-driver/lib in it, and vim works as expected. I’m not sure why I
did this, because my build seems to work without it. This may explain why
my ldd output differs inside and outside my nix-shell environment.

So I guess my next question is: if I did want to put those packages’
libraries into my library loader path, how am I supposed to do it? I tried
this:

LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${stdenv.lib.makeLibraryPath libs}";

but that doesn’t work for, perhaps, obvious reasons.

Thanks for the help on this!!

roni
​


shell.nix
Description: Binary data
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] weird garbage output inside nix-shell

2017-06-10 Thread Roni Choudhury
Hi all-

Linus, Sam, and Sergiu - thank you for the suggestions. I did poke around
in the output from `env` and discovered IN_NIX_SHELL, and arranged my
.zshrc to show `${name}` when `$IN_NIX_SHELL` is true. Fantastic!

I'm not sure the other problem has to do with character encodings (though I
don't know too much about how that works). I did notice that `ldd $(which
vim)` shows me different results when I am inside my nix-shell vs. when I'm
not. I kind of thought I shouldn't even be able to launch vim from inside
my shell if it's not listed as a buildDep.

If I send my shell.nix, would someone else mind trying to use it to see if
you can reproduce my strange results?

Thanks!

roni

On Fri, Jun 9, 2017 at 9:40 AM Sergiu Ivanov  wrote:

> Hello Roni,
>
> Thus quoth  Roni Choudhury  at 13:24 on Wed, Jun 07 2017:
> > On Wed, Jun 7, 2017 at 12:14 AM Samuel Leathers 
> wrote:
> >
> >> I use nix-shell --run zsh. I alias that to nshell.
> >>
> > Thanks, Sam, this is a great idea! On this note, do you know of a good
> way
> > to update the prompt to reflect the nix-shell environment I'm in? i.e.,
> is
> > there a way to *name* the nix-shell env, and get access to that name
> > through an environment variable?
>
>   nix-shell --run 'MY_SHELL_NAME=foo zsh'
>
> will allow you to tag the shell with a custom environment variable.
>
> If you want to update the prompt, you should probably play around with
> shell prompt variables (like PS1 in bash):
>
>
> http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Prompt-Expansion
>
>
> > I wanted to add that even if I don't drop into zsh as my first act in the
> > nix-shell, I still get that weird output from executables not in the
> > environment (such as `zsh` and `git`). If anyone has any insight or can
> > answer my other question, that would be great.
>
> My first reaction on seeing your very first mail was that you were
> probably having issues with processing of ASCII terminal codes.
> Unfortunately, I don't have any clear suggestions.
>
> Have you tried running the commands in different terminal emulators?
>
> --
> Sergiu
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] weird garbage output inside nix-shell

2017-06-09 Thread Roni Choudhury
On Wed, Jun 7, 2017 at 12:14 AM Samuel Leathers  wrote:

> I use nix-shell --run zsh. I alias that to nshell.
>
Thanks, Sam, this is a great idea! On this note, do you know of a good way
to update the prompt to reflect the nix-shell environment I'm in? i.e., is
there a way to *name* the nix-shell env, and get access to that name
through an environment variable?

I wanted to add that even if I don't drop into zsh as my first act in the
nix-shell, I still get that weird output from executables not in the
environment (such as `zsh` and `git`). If anyone has any insight or can
answer my other question, that would be great.

Thanks!

roni

> On Tue, Jun 6, 2017, 08:07 Roni Choudhury  wrote:
>
>> Hi all!
>>
>> I’m using nix-shell to do some development. I have the environment set
>> up so I can build my code, but I had a question about invoking packages not
>> in the shell’s environment. For instance, in that shell, when I run vim,
>> I get output like this:
>>
>> vim: àΠbü : x#í : Error 224711464
>> vim:  }ÿ : xépOö : Error 1320334120
>>
>> These two lines came from two different invocations - note how the output
>> seems to be random.
>>
>> If I include vim in shell.nix, then I don’t see this problem. (I don’t
>> want to include vim in shell.nix in this case, because I don’t think the
>> choice of editor is critical to the build environment, etc.)
>>
>> My main question is: *what is causing this strange output?*
>>
>> My secondary question: *how do I invoke nix-shell in such a way as to
>> instantiate the environment specified in shell.nix, plus a few “custom”
>> packages (such as vim)?*
>>
>> I guess I should mention that my shell of choice is zsh. When I run
>> nix-shell I get dropped into a bash shell. From there, if I invoke zsh
>> I’m back where I want to be. Could that quirk have something to do with
>> this?
>>
>> Thanks in advance!
>>
>> roni
>> ​
>>
> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] weird garbage output inside nix-shell

2017-06-06 Thread Roni Choudhury
Hi all!

I’m using nix-shell to do some development. I have the environment set up
so I can build my code, but I had a question about invoking packages not in
the shell’s environment. For instance, in that shell, when I run vim, I get
output like this:

vim: àΠbü : x#í : Error 224711464
vim:  }ÿ : xépOö : Error 1320334120

These two lines came from two different invocations - note how the output
seems to be random.

If I include vim in shell.nix, then I don’t see this problem. (I don’t want
to include vim in shell.nix in this case, because I don’t think the choice
of editor is critical to the build environment, etc.)

My main question is: *what is causing this strange output?*

My secondary question: *how do I invoke nix-shell in such a way as to
instantiate the environment specified in shell.nix, plus a few “custom”
packages (such as vim)?*

I guess I should mention that my shell of choice is zsh. When I run
nix-shell I get dropped into a bash shell. From there, if I invoke zsh I’m
back where I want to be. Could that quirk have something to do with this?

Thanks in advance!

roni
​
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] how to find packages by file?

2017-03-15 Thread Roni Choudhury
Hi all-

I have some newbie-type questions, I hope that's ok.

Right now I am trying to set up a shell.nix file for a project that is not
necessarily designed to work under Nix. I'm going about this mainly by
dropping into an "empyt" shell, ru nning the build process, observing what
fails, then adding a dependency to shell.nix file and trying again.

My main question is, *how do I know what package to include to make use of
a given file?* By way of example, I currently require the file
*libpangocairo-1.0.so.0*. I have this file in my nix store, at this path:
*/nix/store/zb524gnvar0ymb47m1jcy667f7cci6g1-pango-1.40.3/lib/libpangocairo-1.0.so.0*.
However, if I include "pango" in my buildInputs, I wind up with the package
at path */nix/store/d2xiaxchih5wz4h9kgndfz3qj8vn1znr-pango-1.40.3-bin*,
which does not contain the library files I need, nor even a lib directory.
With fontconfig, I am able to include fontconfig.lib in my buildInputs to
get the libraries for that package (and also fontconfig.dev to get header
files, etc.), but pango has no lib attribute. So my second question is, *how
do I know whether a package has .lib or .dev attributes?*

A followup question: *if I didn't have libpangocairo.* already in my store,
how would I know which package delivers it?*

And perhaps a related final question: *how do I know where a given
directory in /nix/store "came from" - that is, how can I link something in
the store to something in nixpkgs?*

I realize these are probably basic questions, but I'm trying to bootstrap
myself into higher understanding. Thanks in advance!

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


Re: [Nix-dev] ImageMagick and xwd

2016-12-06 Thread Roni Choudhury
Glad I could help!

roni

On Tue, Dec 6, 2016, 3:53 AM Eike  wrote:

>
> Hi Roni,
>
> thank you so much! This works perfectly. I didn't know about the import
> command, this is very convenient.
>
> Thanks again and kind regards
> Eike
>
> Roni Choudhury  writes:
>
> > Hi Eike-
> >
> > You have to let *convert* know the image type coming in on stdin:
> >
> > *xwd -root | convert xwd:- screenshot.jpg*
> >
> > You may also be interested to know about the *import* command, which
> comes
> > with ImageMagick:
> >
> > *import -window root screenshot.png*
> >
> > That command will take a screenshot and automatically convert to an
> output
> > format based on the file extension you choose.
> >
> > Hope this helps,
> >
> > roni
> >
> > On Tue, Nov 29, 2016 at 6:25 AM Eike  wrote:
> >
> >>
> >> Hello,
> >>
> >> I'm used to do screenshots with xwd and imagemagick like this:
> >>
> >> xwd -root | convert - screenshot.jpg
> >>
> >> Currently (17.03pre95306.a24728f (Gorilla)) with imagemagick 6.9.6-2 I
> >> cannot convert xwd dumps to jpgs anymore:
> >>
> >> $ xwd -root | convert - screenshot.jpg
> >> convert: no decode delegate for this image format `' @
> >> error/constitute.c/ReadImage/504.
> >> convert: no images defined `screenshot.jpg' @
> >> error/convert.c/ConvertImageCommand/3257.
> >>
> >> I tested with the version of commit fa6c6dae7 (which is 6.9.5-10)
> >> successfully but with the update to 6.9.6-2 (commit 241cd0e5d) it
> >> stopped working. So it looks like it is not supported anymore with
> >> imagemagick 6.9.6?
> >>
> >> I could not find related info doing a quick search on the web. Does
> >> anyone know more about this?
> >>
> >> Thanks and regards
> >> Eike
> >>
> >> --
> >> gpg: AD7AC35E
> >> finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
> >> ___
> >> nix-dev mailing list
> >> nix-dev@lists.science.uu.nl
> >> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >>
>
>
> --
> gpg: AD7AC35E
> finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] ImageMagick and xwd

2016-12-05 Thread Roni Choudhury
Hi Eike-

You have to let *convert* know the image type coming in on stdin:

*xwd -root | convert xwd:- screenshot.jpg*

You may also be interested to know about the *import* command, which comes
with ImageMagick:

*import -window root screenshot.png*

That command will take a screenshot and automatically convert to an output
format based on the file extension you choose.

Hope this helps,

roni

On Tue, Nov 29, 2016 at 6:25 AM Eike  wrote:

>
> Hello,
>
> I'm used to do screenshots with xwd and imagemagick like this:
>
> xwd -root | convert - screenshot.jpg
>
> Currently (17.03pre95306.a24728f (Gorilla)) with imagemagick 6.9.6-2 I
> cannot convert xwd dumps to jpgs anymore:
>
> $ xwd -root | convert - screenshot.jpg
> convert: no decode delegate for this image format `' @
> error/constitute.c/ReadImage/504.
> convert: no images defined `screenshot.jpg' @
> error/convert.c/ConvertImageCommand/3257.
>
> I tested with the version of commit fa6c6dae7 (which is 6.9.5-10)
> successfully but with the update to 6.9.6-2 (commit 241cd0e5d) it
> stopped working. So it looks like it is not supported anymore with
> imagemagick 6.9.6?
>
> I could not find related info doing a quick search on the web. Does
> anyone know more about this?
>
> Thanks and regards
> Eike
>
> --
> gpg: AD7AC35E
> finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev