Re: [Nix-dev] nix-shell with overlay?

2017-03-08 Thread Profpatsch
On 17-03-08 10:16pm, Nicolas Pierron wrote:
> On Wed, Mar 8, 2017 at 11:01 AM, Benno Fünfstück
>  wrote:
> > Nicolas Pierron  schrieb am Mi., 8. März 2017,
> > 01:30:
> >>
> >> nit: super.callPackage, as the super.callPackage *function* already
> >> aliases self packages.  Otherwise, you would be going twice through
> >> the fix-point.
> >
> > What if someone later wants to override callPackage?
> 
> Later, this person would have to face the fact that security updates
> are not applied.

Ah, it influences security updates.
Is your talk from Nixcon still up-to-date in that respect?

-- 
Proudly written in Mutt with Vim on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
May take up to five days to read your message. If it’s urgent, call me.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell with overlay?

2017-03-08 Thread Nicolas Pierron
On Wed, Mar 8, 2017 at 11:01 AM, Benno Fünfstück
 wrote:
> Nicolas Pierron  schrieb am Mi., 8. März 2017,
> 01:30:
>>
>> nit: super.callPackage, as the super.callPackage *function* already
>> aliases self packages.  Otherwise, you would be going twice through
>> the fix-point.
>
> What if someone later wants to override callPackage?

Later, this person would have to face the fact that security updates
are not applied.

The documentation is clear that if this is a function or a recipe,
then it should be coming from `super`, if this is a dependency it
should come from `self`.  `callPackage` is a function, which captures
`self` to provide default dependencies, so it should be taken out of
`super`.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell with overlay?

2017-03-08 Thread Benno Fünfstück
Nicolas Pierron  schrieb am Mi., 8. März 2017,
01:30:

> nit: super.callPackage, as the super.callPackage *function* already
> aliases self packages.  Otherwise, you would be going twice through
> the fix-point.
>

What if someone later wants to override callPackage?

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


Re: [Nix-dev] nix-shell with overlay?

2017-03-07 Thread Profpatsch
On 17-03-08 01:29am, Nicolas Pierron wrote:
> >> import  {
> >>   overlays: [(self: super: {
> >> myDep = super.myDep.override {
> >>   …
> >> };
> >> myPkg = self.callPackage ./. {};
> 
> nit: super.callPackage, as the super.callPackage *function* already
> aliases self packages.  Otherwise, you would be going twice through
> the fix-point.

Wait, super.callPackage will already have myDep with overrides?
Doesn’t that make the Definition of callPackage questionable?

-- 
Proudly written in Mutt with Vim on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
May take up to five days to read your message. If it’s urgent, call me.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell with overlay?

2017-03-07 Thread Nicolas Pierron
On Tue, Mar 7, 2017 at 5:14 PM, Matthias Beyer  wrote:
> On 07-03-2017 16:33:15, Profpatsch wrote:
>> On 17-03-07 03:57pm, Matthias Beyer wrote:
>> > Hi,
>> >
>> > is there a way to import an overlay in a default.nix for a nix-shell
>> > and use the packages from the overlay in the nix-shell only, without
>> > installing the overlay "globally" for my user?
>> >
>> > If yes, how?
>>
>> Not sure what you mean, how about just adding the overlay to the default.nix?
>>
>> import  {
>>   overlays: [(self: super: {
>> myDep = super.myDep.override {
>>   …
>> };
>> myPkg = self.callPackage ./. {};

nit: super.callPackage, as the super.callPackage *function* already
aliases self packages.  Otherwise, you would be going twice through
the fix-point.

>>   })];
>> }
>
> Ah, nice! But I also have to fetch the overlay in the expression...
> (I'm trying to get the rust-overlay from mozilla to work)

you can import it in the list of overlays.

  overlays = [ (import ~/nixpkgs-mozilla/rust-overlay.nix) ]

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell with overlay?

2017-03-07 Thread Matthias Beyer
On 07-03-2017 16:33:15, Profpatsch wrote:
> On 17-03-07 03:57pm, Matthias Beyer wrote:
> > Hi,
> > 
> > is there a way to import an overlay in a default.nix for a nix-shell 
> > and use the packages from the overlay in the nix-shell only, without 
> > installing the overlay "globally" for my user?
> > 
> > If yes, how?
> 
> Not sure what you mean, how about just adding the overlay to the default.nix?
> 
> import  {
>   overlays: [(self: super: {
> myDep = super.myDep.override {
>   …
> };
> myPkg = self.callPackage ./. {};
>   })];
> }

Ah, nice! But I also have to fetch the overlay in the expression...
(I'm trying to get the rust-overlay from mozilla to work)

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Consider switching to free software.
It adds value to your life.
https://www.gnu.org/


signature.asc
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell with overlay?

2017-03-07 Thread Profpatsch
On 17-03-07 03:57pm, Matthias Beyer wrote:
> Hi,
> 
> is there a way to import an overlay in a default.nix for a nix-shell 
> and use the packages from the overlay in the nix-shell only, without 
> installing the overlay "globally" for my user?
> 
> If yes, how?

Not sure what you mean, how about just adding the overlay to the default.nix?

import  {
  overlays: [(self: super: {
myDep = super.myDep.override {
  …
};
myPkg = self.callPackage ./. {};
  })];
}

nix-build -A myPkg

echo "(import ./.).myPkg" > shell.nix
nix-shell

-- 
Proudly written in Mutt with Vim on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
May take up to five days to read your message. If it’s urgent, call me.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] nix-shell with overlay?

2017-03-07 Thread Matthias Beyer
Hi,

is there a way to import an overlay in a default.nix for a nix-shell 
and use the packages from the overlay in the nix-shell only, without 
installing the overlay "globally" for my user?

If yes, how?

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Consider switching to free software.
It adds value to your life.
https://www.gnu.org/


signature.asc
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev