Re: [Nix-dev] Using system.autoUpgrade with a git channel

2017-07-06 Thread John Ramsden via nix-dev
Thanks that's helpful. In other words if I'm using a checked out git
repository I'm no longer able to use 'system.autoUpgrade'.

-- 
  John Ramsden

On Thu, Jul 6, 2017, at 10:56 PM, Vladimír Čunát wrote:
> On 07/07/2017 01:46 AM, John Ramsden via nix-dev wrote:
> > I was also wondering what exactly the 'nixos-rebuild switch' command's
> > '--upgrade' flag does.
> 
> It does
> $ nix-channel --update nixos
> Best see the source if you want details, as it's relatively simple:
> https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-rebuild.sh#L197
> 
> --Vladimir
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] error: cannot auto-call a function that has an argument without a default value (‘stdenv’)

2017-07-06 Thread Vladimír Čunát via nix-dev
On 07/06/2017 05:54 PM, tj5527 via nix-dev wrote:
> Following the example
> at http://nixos.org/nix/manual/#chap-writing-nix-expressions to build
> hello package. But `nix-build -A hello` throws error "error: cannot
> auto-call a function that has an argument without a default value
> (‘stdenv’)"
> 
> How can I fix this problem?

Well, apparently you try to evaluate a standalone file that specifies a
function but you don't specify how to fill its parameters.  It should be
explained in the following section
http://nixos.org/nix/manual/#sec-arguments

That's how it's commonly done in nixpkgs.  If you want a *separate*
expression that depends on nixpkgs, you may e.g. start by adding this
line to the beginning of the file:
with import  {};
instead of
{ stdenv, something1, something2, ... }:

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


Re: [Nix-dev] unequal build hash

2017-07-06 Thread Vladimír Čunát via nix-dev
On 07/06/2017 07:35 PM, Harmen via nix-dev wrote:
> Does that makes sense? Did I forget a 'name' somewhere?

When you use things like
  src = ./.;
the directory gets copied into nix store and the resulting path's name
is based on the name of the directory.

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


Re: [Nix-dev] Using system.autoUpgrade with a git channel

2017-07-06 Thread Vladimír Čunát via nix-dev
On 07/07/2017 01:46 AM, John Ramsden via nix-dev wrote:
> I was also wondering what exactly the 'nixos-rebuild switch' command's
> '--upgrade' flag does.

It does
$ nix-channel --update nixos
Best see the source if you want details, as it's relatively simple:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-rebuild.sh#L197

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


[Nix-dev] OpenJDK 9

2017-07-06 Thread Matt McHenry via nix-dev
Just a heads-up that I'm working on getting this to build, if anyone
else is interested: https://github.com/NixOS/nixpkgs/pull/27194

So far, jigsaw / modularization does not seem to have required nearly
as many changes to the nix expression as I would've guessed.  :)
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Using system.autoUpgrade with a git channel

2017-07-06 Thread John Ramsden via nix-dev
 I'm currently using  a checked out version of the channels repository
 as my channel. I was previously using the integrated channel and using
 'system.autoUpgrade.enable = true'. I assume I can no longer use this
 service for upgrades while I'm using git. Is there any way to run auto
 upgrades while using a checked out git repository? 

I was also wondering what exactly the 'nixos-rebuild switch' command's
'--upgrade' flag does. I was unable to tell from the module, and the man
page just says:

   --upgrade
   Fetch the latest version of NixOS from the NixOS channel.

Does this means the command just pulls new additions to the nix channel
that is selected?

Seeing as the NixOS channel is just a git repository, is there a way I
can configure the auto upgrades to work with my checked out git
repository? All I've done is cherrypicked a few commits and added them
to the 17.03 channel locally.

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


Re: [Nix-dev] unequal build hash

2017-07-06 Thread Harmen via nix-dev
On Thu, Jul 06, 2017 at 06:35:15PM +0200, Harmen via nix-dev wrote:
> Hello all,
> another day, another problem :/
> 
> I'm trying to figure out why a build generates different build IDs in 
> different
> contexts.
> I have a nix expression and some code. If I copy that from machine A
> to machine B they both give the same build hash. All's fine there.
> If on machine B I run nix-build in a docker container it won't give the same
> build hash.
> `nix-hash .` gives the same hash for B and B-docker. Same nix version, same
> nixpkgs version.

I'm getting a bit further, and it worked on different machines because I
happened to name the directory the same on both machines. Seems like the name
of the directory is used in the build process. As long as I checkout the repo
in a subdir with the same name everything is fine. If I rename the checkout dir
nix will rebuild. This my current default.nix:


with pkgs; buildGoPackage rec {
  name = "mypackage";
  src = builtins.filterSource
   (name: type:
 (lib.hasPrefix (toString ./vendor) name) ||
 (lib.hasPrefix (toString ./rzutil) name) ||
 (lib.hasPrefix (toString ./util) name) ||
 (lib.hasPrefix (toString ./datatype) name) ||
 (lib.hasPrefix (toString ./one) name)
   ) ./.;

  goPackagePath = "example.com/mypackage";

  meta = with stdenv.lib; {
description = "My First Package";
homepage = https://github.com/example-com/mypackage;
platforms = platforms.unix;
  };
}

If I do the checkout in /tmp/fooo part of the .drv gives:

...

["/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh","/nix/store/zw7ax2gxc8qr5cx5a7byjpxdshx73297-fooo"]
...

Does that makes sense? Did I forget a 'name' somewhere?

Thanks!

> 
> Any hints what to look for?
> Thanks!
> ___
> 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] unequal build hash

2017-07-06 Thread Harmen via nix-dev
Hello all,
another day, another problem :/

I'm trying to figure out why a build generates different build IDs in different
contexts.
I have a nix expression and some code. If I copy that from machine A
to machine B they both give the same build hash. All's fine there.
If on machine B I run nix-build in a docker container it won't give the same
build hash.
`nix-hash .` gives the same hash for B and B-docker. Same nix version, same
nixpkgs version.

Any hints what to look for?
Thanks!
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] error: cannot auto-call a function that has an argument without a default value (‘stdenv’)

2017-07-06 Thread tj5527 via nix-dev
Following the example at 
http://nixos.org/nix/manual/#chap-writing-nix-expressions to build hello 
package. But `nix-build -A hello` throws error "error: cannot auto-call a 
function that has an argument without a default value (‘stdenv’)"
How can I fix this problem?
My nix-build (Nix) is 1.11.11
Thanks___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-daemon and private git repos

2017-07-06 Thread Harmen via nix-dev
On Tue, Jul 04, 2017 at 08:10:09PM +, zimbatm wrote:

Thanks for the suggestions.

I took away from this that it's best to not have Nix deal with the checkouts.
For now I'll keep things as separate repos, to keep things easier.

Eventually I would like to go to one pkgs tree for all repos, but I'll think
about how to do that best. It also ties into integration and system testing,
which is not just Nix related.

thanks!
Harmen
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev