[Nix-dev] Where would I put the bootstrapping guide?

2015-04-28 Thread Jookia
Hello!

Recently I've bootstrapped NixOS on to a new ARM platform from an 
existing Debian install on the same platform. I figured this is useful 
knowledge so I've written up some documentation which I'm in the process 
of convert to Docbook. It's kind of a tutorial but expects users to 
modify commands.

The guide includes how to install Nix, the NixOS installer and finally 
NixOS on a system such as Debian. It's three sections long and intended 
for development and porting NixOS to new platforms.

I originally wrote it for inclusion in the Wiki but I'm barred from it 
as I use Tor, so I'm beginning to wonder if there's a place for it in 
the official documentation around the installation section. The 
obviously place would be in the installer section but it focuses on 
using a CD.

Any suggestions? I'd really love to make it easier to install NixOS when 
there isn't already an installer image.

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


[Nix-dev] Assertion failed crossSystem == null

2015-04-28 Thread Rahul Muttineni
I am on commit b2f426d9816ae1b0dfc8e6cd2e8dd23d9326182f and the following
error is occuring.

$ nix-shell -f /path/to/nixpkgs
error: assertion failed at
/home/rahulmutt/src/nixpkgs/pkgs/top-level/all-packages.nix:4971:15

Tracing, I find that it corresponds to binutilsCross expression and the
assertion fails at crossSystem != null. I am running ubuntu 14.04. How do I
resolve this error?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] pybitmessage python help

2015-04-28 Thread Tomas Hlavaty
Hi,

I'm writing a nix expression for PyBitMessage:

{stdenv, fetchgit, python27, qt4, pyqt4, sqlite, openssl, mpg123}:

stdenv.mkDerivation rec {
  name = "pybitmessage-v0.4.4";

  src = fetchgit {
url = "https://github.com/Bitmessage/PyBitmessage.git";;
rev = "713ed89467b9c766cb22df0cc51415a93fd1801d";
sha256 = "0d70xj0bap7dwh1lj8fj0k0hwhfnzgz2g5jlh2sgqpaqpd74q1dq";
  };

  #pythonPath = [pyqt4];

  #buildInputs = [python27 pythonPackages.wrapPython];

  propagatedBuildInputs = [qt4 pyqt4 sqlite openssl mpg123];

  installPhase = ''
mkdir -p $out/share/pybitmessage
cp -r src/* $out/share/pybitmessage/
mkdir -p $out/bin
ln -s $out/share/pybitmessage/bitmessagemain.py $out/bin/pybitmessage
  '';

  meta = with stdenv.lib; { 
homepage = https://bitmessage.org;
description = "Bitmessage is a P2P communications protocol";
license = licenses.mit;
  };
}

However, python cannot find pyqt4:

% pybitmessage 
pybitmessage 
Loading existing config files from /home/tomas/.config/PyBitmessage/
2015-04-28 23:23:44,401 - DEBUG - Database file already exists.
2015-04-28 23:23:44,656 - DEBUG - Loaded 0 objects from disk into the 
objectProcessorQueue.
2015-04-28 23:23:44,657 - DEBUG - reloading keys from keys.dat file
2015-04-28 23:23:44,766 - DEBUG - reloading subscriptions...
An Exception occurred within 
isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections: invalid version 
number '#1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015'
PyBitmessage requires PyQt unless you want to run it as a daemon and interact 
with it using the API. You can download PyQt from 
http://www.riverbankcomputing.com/software/pyqt/download   or by searching 
Google for 'PyQt Download'. If you want to run in daemon mode, see 
https://bitmessage.org/wiki/Daemon
('Error message:', ImportError('No module named PyQt4',))
You can also run PyBitmessage with the new curses interface by providing
'-c' as a commandline argument.


I tried searching nixpkgs and trying things but have not managed to
figure it out.  Does somebody have an idea, how to get it to work?

Thanks a lot,

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


Re: [Nix-dev] Haskell NG: Local packages

2015-04-28 Thread Ertugrul Söylemez
Hi Jeff,

I'm using a similar approach for non-Haskell packages.  However, for
Haskell packages it doesn't interact well with cabal2nix.  Hence my
question.  I have now solved it the following way in
`~/.nixpkgs/config.nix`:

haskellPackageOverrides = self: super:
let asDarcs = path:
(self.callPackage (import path) {}).override (args: args // {
mkDerivation = expr:
args.mkDerivation (expr // {
src = nixos.pkgs.fetchdarcs { url = path; };
});
});
in {
myxmonad   = self.callPackage  {};
mytaffybar = self.callPackage  {};
testpkg1   = asDarcs ;
testpkg2   = asDarcs ;
};

The testpkg2 executable depends on the testpkg1 library, and it works.
The expressions are generated by cabal2nix, so no manual work is
involved.  So it seems to do exactly what it should.

> It's not specific to Haskell (and I haven't tried haskellng at all
> yet) but for personal packages I have mypkgs//default.nix,
> and then a top-level mypkgs/default.nix:
>
> [...]
>
> I add that to my NIX_PATH so I can `import ` anywhere to get
>  overridden with the stuff I'm working on.


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] Haskell NG: Local packages

2015-04-28 Thread Jeffrey David Johnson
It's not specific to Haskell (and I haven't tried haskellng at all yet) but for
personal packages I have mypkgs//default.nix, and then a top-level
mypkgs/default.nix:

let
  nixpkgs = import  {};
  callPkg = nixpkgs.newScope
(  nixpkgs
// nixpkgs.haskellPackages
// nixpkgs.python27Packages
// self
);

  self = {
canonicalFilepath = callPkg ./canonical-filepath {} ;
filestore = callPkg ./filestore  {} ;
gitit = callPkg ./gitit  {} ;
igv   = callPkg ./igv{} ;
igvtools  = callPkg ./igvtools   {} ;
indentparser  = callPkg ./indentparser   {} ;
jeffkb= callPkg ./jeffkb {} ;
jeffwiki  = callPkg ./jeffwiki   {} ;
ncbi-blast= callPkg ./ncbi-blast {} ;
rPackages = callPkg ./r-modules  {} ;
scan2pdf  = callPkg ./scan2pdf   {} ;
scripts   = callPkg ./scripts{} ;
tarql = callPkg ./tarql  {} ;
tasktree  = callPkg ./tasktree   {} ;
tsync = callPkg ./tsync  {} ;
  };

  in (nixpkgs // self)

I add that to my NIX_PATH so I can `import ` anywhere to get 
overridden with the stuff I'm working on.
Jeff

On Tue, 28 Apr 2015 22:11:57 +0200
Ertugrul Söylemez  wrote:

> I believe Peter's message <87mw5qvj9x@write-only.cryp.to> could
> answer my question.  I will give it a try.
> 
> > Hello fellow Haskellers,
> >
> > I have a bunch of local Haskell packages, mostly libraries.  The package
> > X lives in the directory ``.  There are lots of direct
> > and indirect dependencies between them.  My current solution is ad hoc
> > and rather ugly.  I'm using the following hand-crafted `shell.nix` file
> > in every project:
> >
> > { pkgs ? import  {} }:
> >
> > let inherit (pkgs.haskellngPackages) callPackage;
> >
> > extPkg = path: deps:
> > (callPackage (import path) deps).override (args: args // {
> > mkDerivation = expr:
> > args.mkDerivation (expr // {
> > src = pkgs.fetchdarcs { url = path; };
> > });
> > });
> >
> > thisPkg = callPackage (import ./devel.nix) {
> > direct-dep1 = extPkg  {
> > indirect-dep1 = ...;
> > indirect-dep2 = ...;
> > };
> > direct-dep2 = extPkg  {};
> > };
> >
> > in thisPkg.env
> >
> > Do not pay too much attention to the `extPkg` function.  It just works
> > around cabal2nix' lack of support for Darcs URLs.
> >
> > My question is:  Is there a nicer and more principled way to solve this?
> > Ideally I could simply add all of my local packages in some way to my
> > `~/.nixpkgs/config.nix`.  Then they could just depend on each other
> > regularly and I wouldn't need any shell.nix hackery.  I'm guessing that
> > I need to override haskellngPackages in some way or perhaps create my
> > own using some override.
> >
> >
> > Greets,
> > Ertugrul
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] texinfo4 seems to have a /bin/sh dependency

2015-04-28 Thread Tyson Whitehead
I switch to the nixos-unstable channel as I noticed the nixpkgs-unstable last 
update was March 22nd.

http://nixos.org/channels/

Installed the nixpkgs.pkgs.nixUnstable (nix-1.9pre4088_1711679) from this and 
it seems to have resolved the issue.

Thanks!  -Tyson

On April 27, 2015 15:13:22 Tyson Whitehead wrote:
> I upgraded to nixUnstable (nix-1.9pre4074_e659978) but it does not seem to 
> have resolved this issue
> 
> ...
>
> Is this what you had in mind or is there something I'm missing here?
> 
> On April 27, 2015 11:53:54 William Kennington wrote:
> > On NixOS, nix is configured to not only provide the chroot but also /bin/sh
> > compatability. This is fixed in nix 1.9 so I recommend just using the
> > unstable version of nix as it should just work.

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


Re: [Nix-dev] Haskell NG: Local packages

2015-04-28 Thread Ertugrul Söylemez
> I believe Peter's message <87mw5qvj9x@write-only.cryp.to> could
> answer my question.  I will give it a try.

It does and works well.  Thanks anyway!


>> I have a bunch of local Haskell packages, mostly libraries.  The package
>> X lives in the directory ``.  There are lots of direct
>> and indirect dependencies between them.  My current solution is ad hoc
>> and rather ugly.  I'm using the following hand-crafted `shell.nix` file
>> in every project:
>>
>> { pkgs ? import  {} }:
>>
>> let inherit (pkgs.haskellngPackages) callPackage;
>>
>> extPkg = path: deps:
>> (callPackage (import path) deps).override (args: args // {
>> mkDerivation = expr:
>> args.mkDerivation (expr // {
>> src = pkgs.fetchdarcs { url = path; };
>> });
>> });
>>
>> thisPkg = callPackage (import ./devel.nix) {
>> direct-dep1 = extPkg  {
>> indirect-dep1 = ...;
>> indirect-dep2 = ...;
>> };
>> direct-dep2 = extPkg  {};
>> };
>>
>> in thisPkg.env
>>
>> Do not pay too much attention to the `extPkg` function.  It just works
>> around cabal2nix' lack of support for Darcs URLs.
>>
>> My question is:  Is there a nicer and more principled way to solve this?
>> Ideally I could simply add all of my local packages in some way to my
>> `~/.nixpkgs/config.nix`.  Then they could just depend on each other
>> regularly and I wouldn't need any shell.nix hackery.  I'm guessing that
>> I need to override haskellngPackages in some way or perhaps create my
>> own using some override.


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] Haskell NG: Local packages

2015-04-28 Thread Ertugrul Söylemez
I believe Peter's message <87mw5qvj9x@write-only.cryp.to> could
answer my question.  I will give it a try.

> Hello fellow Haskellers,
>
> I have a bunch of local Haskell packages, mostly libraries.  The package
> X lives in the directory ``.  There are lots of direct
> and indirect dependencies between them.  My current solution is ad hoc
> and rather ugly.  I'm using the following hand-crafted `shell.nix` file
> in every project:
>
> { pkgs ? import  {} }:
>
> let inherit (pkgs.haskellngPackages) callPackage;
>
> extPkg = path: deps:
> (callPackage (import path) deps).override (args: args // {
> mkDerivation = expr:
> args.mkDerivation (expr // {
> src = pkgs.fetchdarcs { url = path; };
> });
> });
>
> thisPkg = callPackage (import ./devel.nix) {
> direct-dep1 = extPkg  {
> indirect-dep1 = ...;
> indirect-dep2 = ...;
> };
> direct-dep2 = extPkg  {};
> };
>
> in thisPkg.env
>
> Do not pay too much attention to the `extPkg` function.  It just works
> around cabal2nix' lack of support for Darcs URLs.
>
> My question is:  Is there a nicer and more principled way to solve this?
> Ideally I could simply add all of my local packages in some way to my
> `~/.nixpkgs/config.nix`.  Then they could just depend on each other
> regularly and I wouldn't need any shell.nix hackery.  I'm guessing that
> I need to override haskellngPackages in some way or perhaps create my
> own using some override.
>
>
> Greets,
> Ertugrul


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


[Nix-dev] Haskell NG: Local packages

2015-04-28 Thread Ertugrul Söylemez
Hello fellow Haskellers,

I have a bunch of local Haskell packages, mostly libraries.  The package
X lives in the directory ``.  There are lots of direct
and indirect dependencies between them.  My current solution is ad hoc
and rather ugly.  I'm using the following hand-crafted `shell.nix` file
in every project:

{ pkgs ? import  {} }:

let inherit (pkgs.haskellngPackages) callPackage;

extPkg = path: deps:
(callPackage (import path) deps).override (args: args // {
mkDerivation = expr:
args.mkDerivation (expr // {
src = pkgs.fetchdarcs { url = path; };
});
});

thisPkg = callPackage (import ./devel.nix) {
direct-dep1 = extPkg  {
indirect-dep1 = ...;
indirect-dep2 = ...;
};
direct-dep2 = extPkg  {};
};

in thisPkg.env

Do not pay too much attention to the `extPkg` function.  It just works
around cabal2nix' lack of support for Darcs URLs.

My question is:  Is there a nicer and more principled way to solve this?
Ideally I could simply add all of my local packages in some way to my
`~/.nixpkgs/config.nix`.  Then they could just depend on each other
regularly and I wouldn't need any shell.nix hackery.  I'm guessing that
I need to override haskellngPackages in some way or perhaps create my
own using some override.


Greets,
Ertugrul


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] Why is nodejs-7f considered an upgrade to nodejs?

2015-04-28 Thread Eelco Dolstra
Hi,

On 28/04/15 19:04, Richard Wallace wrote:

> I keep running into this issue whenever I run `nix-env --upgrade` that nix-env
> thinks that nodePackages.7f is an upgrade to nodejs.  Consequently, I have to
> force a "downgrade" to the nodejs package after every upgrade.  Is there a way
> to avoid this?

No, that package should be renamed. "7f" is interpreted by nix-env as a version
because it starts with a digit. Starting an attribute name with a digit is not a
good idea either.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Why is nodejs-7f considered an upgrade to nodejs?

2015-04-28 Thread Richard Wallace
I keep running into this issue whenever I run `nix-env --upgrade` that
nix-env thinks that nodePackages.7f is an upgrade to nodejs.  Consequently,
I have to force a "downgrade" to the nodejs package after every upgrade.
Is there a way to avoid this?

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


Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.

2015-04-28 Thread Wout Mertens
Well, on github we have travis, and line comments, and bug references etc.
It's just nicer, and I haven't seen many patches come in via ML (this was
the first I noticed) so I didn't really have a workflow ready...

On Tue, Apr 28, 2015 at 12:40 PM Shea Levy  wrote:

> As long as I’ve been around we’ve also accepted patches via ML, why not?
>
> > On Apr 28, 2015, at 2:34 AM, Wout Mertens 
> wrote:
> >
> > These patches look useful, but normally we work via github...
> >
> >
> > On Tue, Apr 28, 2015, 4:17 AM Jookia <166...@gmail.com> wrote:
> > When bootstrapping from other distributions, nixos-install is unable to
> find
> > various tools in the chroot since their paths aren't aware of NixOS
> conventions.
> >
> > This makes a small change to existing code by specifying nixpkgs/nixos
> instead
> > of just nixos when running nix-instantiate in the chroot. I haven't
> tested this
> > outside of bootstrapping, but the same specification is used elsewhere
> in the
> > code so I don't see why it wouldn't work.
> > ---
> >  nixos/modules/installer/tools/nixos-install.sh | 8 +++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/nixos/modules/installer/tools/nixos-install.sh
> b/nixos/modules/installer/tools/nixos-install.sh
> > index 14ae3da..86e57f7 100644
> > --- a/nixos/modules/installer/tools/nixos-install.sh
> > +++ b/nixos/modules/installer/tools/nixos-install.sh
> > @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
> >  chroot $mountPoint /nix/var/nix/profiles/system/activate
> >
> >
> > +# Some systems may not be prepared to use NixOS' paths.
> > +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH
> > +export
> NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs
> > +export
> NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
> > +
> > +
> >  # Ask the user to set a root password.
> > -if [ "$(chroot $mountPoint nix-instantiate --eval '' -A
> config.users.mutableUsers)" = true ] && [ -t 0 ] ; then
> > +if [ "$(chroot $mountPoint nix-instantiate --eval '' -A
> config.users.mutableUsers)" = true ] && [ -t 1 ] ; then
> >  echo "setting root password..."
> >  chroot $mountPoint /var/setuid-wrappers/passwd
> >  fi
> > --
> > 2.3.6
> >
> > ___
> > 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
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-28 Thread Eric Merritt
So this is the setuphook of the dependee not the compiler. The directory is
there because the package creates it. Is there some subtlety I am missing
in the way nix handles packages?

On Tue, Apr 28, 2015 at 3:14 AM, Vladimír Čunát  wrote:

> On 04/27/2015 10:42 PM, Eric Merritt wrote:
> > Thanks all of you. I added the following to my dependee (bin_prot) and
> > it worked nicely.
> >
> >  setupHook = writeText "setupHook.sh" ''
> >   export
> >
> CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/bin_prot/"
> > '';
>
> Just note that without testing existence of the directories, the
> variable will likely be filled with many paths from other build inputs.
> Having nonexistent directories in there probably won't matter, although
> it doesn't look nice.
>
> Vladimir
>
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Depending on a service from inside an expression?

2015-04-28 Thread Tomas Hlavaty
Hi Mateusz,

Mateusz Kowalczyk  writes:
> There is a project that as part of its tests has to create a postgresql
> database which means that the postgres server needs to be running.
>
> Is there an easy way to achieve this? How does one go about testing such
> packages to begin with?

I am currently setting something like that (hydra tests) for a nix
module (a systemd service) which requires postgresql.  What works for
me:

1) a nix package file for your program (say foo) so that your program
   compiles and installs

2) a nix env file (say fooEnv) for runtime-only dependencies (not
   detected by nix) which will be deployed as part of the service
   (because there is a limit on the PATH variable length)

3) a nix module file which defines the systemd service.  I have two
   modules:

   - foo-init which takes a long time to set up the database and other
 things

   - foo-service which is the actual service running the foo program

4) a nix vm file which defines a VM with that module plus postgresql
   module.  This is also useful for manually testing the VM.

5) a nix vmtest file which imports nixpkgs/nixos/tests/make-test.nix,
   creates the VM and runs the testScript

If your program doesn't run as a service, you would not need 3) I guess.

nixpkgs/nixos/tests/make-test.nix runs the tests in a fresh qemu machine
which is then discarded.

Cheers,

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


Re: [Nix-dev] [PATCH 2/2] nixos-install: Fix chroot flag not defaulting to Bash outside NixOS.

2015-04-28 Thread Domen Kožar
So https://github.com/NixOS/nixpkgs/pull/7603 can be closed as well. Thank
you Jookia and Shea!

On Tue, Apr 28, 2015 at 12:38 PM, Shea Levy  wrote:

> Applied in 71910be9ea225895e36f60ed23a1bdce402b3088, thanks!
>
> > On Apr 27, 2015, at 10:16 PM, Jookia <166...@gmail.com> wrote:
> >
> > Passing the chroot flag to nixos-install without arguments should now
> give you a
> > Bash shell as intended rather than try an empty path.
> >
> > This was masked by the user's shell (usually /bin/bash) being defaulted
> to by
> > chroot, and being found since their paths used NixOS conventions.
> > ---
> > nixos/modules/installer/tools/nixos-install.sh | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/nixos/modules/installer/tools/nixos-install.sh
> b/nixos/modules/installer/tools/nixos-install.sh
> > index 86e57f7..097631e 100644
> > --- a/nixos/modules/installer/tools/nixos-install.sh
> > +++ b/nixos/modules/installer/tools/nixos-install.sh
> > @@ -45,7 +45,9 @@ while [ "$#" -gt 0 ]; do
> > ;;
> > --chroot)
> > runChroot=1
> > -chrootCommand=("$@")
> > +if [[ "$@" != "" ]]; then
> > +chrootCommand=("$@")
> > +fi
> > break
> > ;;
> > --help)
> > --
> > 2.3.6
> >
> > ___
> > 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
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell dropping into a shell without anything new -- update

2015-04-28 Thread Ramakrishnan Muthukrishnan
On Tue, Apr 28, 2015, at 04:05 PM, Domen Kožar wrote:
> Could you open an issue at github.com/NixOS/nixpkgs ? Thanks!

Yes, done: 

--
Ramakrishnan "Err and err and err again, but less and less and less"
⟶ Piet Hein

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


Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.

2015-04-28 Thread Shea Levy
As long as I’ve been around we’ve also accepted patches via ML, why not?

> On Apr 28, 2015, at 2:34 AM, Wout Mertens  wrote:
> 
> These patches look useful, but normally we work via github...
> 
> 
> On Tue, Apr 28, 2015, 4:17 AM Jookia <166...@gmail.com> wrote:
> When bootstrapping from other distributions, nixos-install is unable to find
> various tools in the chroot since their paths aren't aware of NixOS 
> conventions.
> 
> This makes a small change to existing code by specifying nixpkgs/nixos instead
> of just nixos when running nix-instantiate in the chroot. I haven't tested 
> this
> outside of bootstrapping, but the same specification is used elsewhere in the
> code so I don't see why it wouldn't work.
> ---
>  nixos/modules/installer/tools/nixos-install.sh | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/nixos/modules/installer/tools/nixos-install.sh 
> b/nixos/modules/installer/tools/nixos-install.sh
> index 14ae3da..86e57f7 100644
> --- a/nixos/modules/installer/tools/nixos-install.sh
> +++ b/nixos/modules/installer/tools/nixos-install.sh
> @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
>  chroot $mountPoint /nix/var/nix/profiles/system/activate
> 
> 
> +# Some systems may not be prepared to use NixOS' paths.
> +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH
> +export 
> NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs
> +export 
> NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
> +
> +
>  # Ask the user to set a root password.
> -if [ "$(chroot $mountPoint nix-instantiate --eval '' -A 
> config.users.mutableUsers)" = true ] && [ -t 0 ] ; then
> +if [ "$(chroot $mountPoint nix-instantiate --eval '' -A 
> config.users.mutableUsers)" = true ] && [ -t 1 ] ; then
>  echo "setting root password..."
>  chroot $mountPoint /var/setuid-wrappers/passwd
>  fi
> --
> 2.3.6
> 
> ___
> 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

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


Re: [Nix-dev] [PATCH 2/2] nixos-install: Fix chroot flag not defaulting to Bash outside NixOS.

2015-04-28 Thread Shea Levy
Applied in 71910be9ea225895e36f60ed23a1bdce402b3088, thanks!

> On Apr 27, 2015, at 10:16 PM, Jookia <166...@gmail.com> wrote:
> 
> Passing the chroot flag to nixos-install without arguments should now give 
> you a
> Bash shell as intended rather than try an empty path.
> 
> This was masked by the user's shell (usually /bin/bash) being defaulted to by
> chroot, and being found since their paths used NixOS conventions.
> ---
> nixos/modules/installer/tools/nixos-install.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/nixos/modules/installer/tools/nixos-install.sh 
> b/nixos/modules/installer/tools/nixos-install.sh
> index 86e57f7..097631e 100644
> --- a/nixos/modules/installer/tools/nixos-install.sh
> +++ b/nixos/modules/installer/tools/nixos-install.sh
> @@ -45,7 +45,9 @@ while [ "$#" -gt 0 ]; do
> ;;
> --chroot)
> runChroot=1
> -chrootCommand=("$@")
> +if [[ "$@" != "" ]]; then
> +chrootCommand=("$@")
> +fi
> break
> ;;
> --help)
> -- 
> 2.3.6
> 
> ___
> 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


Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.

2015-04-28 Thread Shea Levy
Applied in 7b37a5f168706db5efa33599354f5c1967ac4c51, thanks!

> On Apr 27, 2015, at 10:16 PM, Jookia <166...@gmail.com> wrote:
> 
> When bootstrapping from other distributions, nixos-install is unable to find
> various tools in the chroot since their paths aren't aware of NixOS 
> conventions.
> 
> This makes a small change to existing code by specifying nixpkgs/nixos instead
> of just nixos when running nix-instantiate in the chroot. I haven't tested 
> this
> outside of bootstrapping, but the same specification is used elsewhere in the
> code so I don't see why it wouldn't work.
> ---
> nixos/modules/installer/tools/nixos-install.sh | 8 +++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/nixos/modules/installer/tools/nixos-install.sh 
> b/nixos/modules/installer/tools/nixos-install.sh
> index 14ae3da..86e57f7 100644
> --- a/nixos/modules/installer/tools/nixos-install.sh
> +++ b/nixos/modules/installer/tools/nixos-install.sh
> @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
> chroot $mountPoint /nix/var/nix/profiles/system/activate
> 
> 
> +# Some systems may not be prepared to use NixOS' paths.
> +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH
> +export 
> NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs
> +export 
> NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
> +
> +
> # Ask the user to set a root password.
> -if [ "$(chroot $mountPoint nix-instantiate --eval '' -A 
> config.users.mutableUsers)" = true ] && [ -t 0 ] ; then
> +if [ "$(chroot $mountPoint nix-instantiate --eval '' -A 
> config.users.mutableUsers)" = true ] && [ -t 1 ] ; then
> echo "setting root password..."
> chroot $mountPoint /var/setuid-wrappers/passwd
> fi
> -- 
> 2.3.6
> 
> ___
> 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


Re: [Nix-dev] nix-shell dropping into a shell without anything new -- update

2015-04-28 Thread Domen Kožar
Could you open an issue at github.com/NixOS/nixpkgs ? Thanks!

On Tue, Apr 28, 2015 at 7:34 AM, Ramakrishnan Muthukrishnan <
r...@rkrishnan.org> wrote:

> On Mon, Apr 27, 2015, at 03:56 PM, Ramakrishnan Muthukrishnan wrote:
> > Hi,
> >
> > Sorry for the badly worded subject line.
> >
> > NixOS newbie here. Playing with NixOS on a VirtualBox installation and
> > really really liking it so far.
> >
> > I am using nix-shell and the quick start example in the manual (step #6
> > listed here: ) does not seem to work for
> > me:
> >
> > [ram@nixos:~] nix-shell -p hello
> > these paths will be fetched (0.04 MiB ...
> >
> > *** Downloading 
> >
> > [ram@nixos:~]$ hello
> > The program `hello' is currently not installed ...
> > ...
> > [ram@nixos:~]$ exit
> >
> > [ram@nixos:~]$
> >
> > Note that the prompt string didn't change when we entered the nix-shell.
> >
> > If I do:
> >
> > [ram@nixos:~]$ nix-shell -p hello --pure
> >
> > [nix-shell:~]$ hello
> > Hello, world!
> >
> > [nix-shell:~]$
> >
> > I wonder why without "--pure" it didn't get into the shell. Would
> > appreciate any help.
>
> I figured that the behaviour that triggered this is the single line in
> the /etc/nixos/configuration.nix:
>
> programs.bash.enableCompletion = true;
>
> If I comment this out, nix-shell runs just fine.
>
> This looks like a bug to me.
> --
>   Ramakrishnan
>   "Err and err and err again, but less and less and less" ⟶ Piet Hein
> ___
> 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


Re: [Nix-dev] texinfo4 seems to have a /bin/sh dependency

2015-04-28 Thread Peter Simons
Hi Tyson,

many packages depend on /bin/sh in one way or another. Remedying that
impurity is a huge effort that's probably characterized best as
"on-going". For the time being, we work around this problem by providing a
/bin/sh in the chroot environment through the following /etc/nix/nix.conf
configuration:

  build-chroot-dirs = /bin/sh=/nix/store/-bash-4.3-p33/bin/bash 
/nix/store/-linux-headers-3.12.32 /nix/store/-glibc-2.21 
/nix/store/-bash-4.3-p33

The first entry creates the /bin/sh path, and the remaining entries
provide the necessary run-time dependencies so that bash can run.

On NixOS, this kind of setup is generated automatically. If you're running
Nix on another host system, then you'll have to figure out the appropriate
paths yourself and add them to your /etc/nix/nix.conf.

Best regards,
Peter

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


Re: [Nix-dev] Vagrant stuff - images and plugin - still alive?

2015-04-28 Thread Domen Kožar
I'd send emails to both authors asking if they plan to update the images :)

On Tue, Apr 28, 2015 at 9:45 AM, Rok Garbas  wrote:

> Quoting Rok Garbas (2015-04-28 09:35:18)
> > Quoting Christian Theune (2015-04-25 13:41:19)
> > > Hi,
> > >
> > > I’ve been working on getting vagrant-based setups working nicely in
> the last
> > > weeks and found
> > >
> > > https://github.com/oxdi/vagrant-nixos
> > > https://github.com/oxdi/nixos
> > > and
> > > https://github.com/zimbatm/nixbox
> > >
> > > The zimbatm has images available, I didn’t get around to using the
> packer
> > > templates, yet.
> > >
> > > The plugin is nice but is not compatible with NixOS 14.12 in the
> released
> > > version. The code has everything fixed already and just making a
> release of
> > > that code works nicely for me. However, I’d love if the gem would be
> publicly
> > > available.
> > >
> > > So, is anyone on this list using Vagrant with NixOS? Is the author of
> the
> > > plugin still around? Alternatives? Should I fork this and start making
> > > releases?
> > >
> >
> > Hi Christian,
> >
> > I would suggest to create a wiki page about vagrant+nixos to keep all the
> > information in one place.
> >
> > currently there is only about virtualbox, but vagrant is quickly
> mentioned at
> > the bottom.
> >
> >
> https://nixos.org/wiki/Installing_NixOS_in_a_VirtualBox_guest#Vagrant_boxes
> >
>
> also i found https://github.com/cstrahan/nix-packer
>
>
> --
> Rok Garbas - http://www.garbas.si
>
> ___
> 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


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-28 Thread Vladimír Čunát
On 04/27/2015 10:42 PM, Eric Merritt wrote:
> Thanks all of you. I added the following to my dependee (bin_prot) and
> it worked nicely.
> 
>  setupHook = writeText "setupHook.sh" ''
>   export
> CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/bin_prot/"
> '';

Just note that without testing existence of the directories, the
variable will likely be filled with many paths from other build inputs.
Having nonexistent directories in there probably won't matter, although
it doesn't look nice.

Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Failed to add route because network is unreachable

2015-04-28 Thread Bas van Dijk
On 28 April 2015 at 09:16, Kirill Elagin  wrote:
> It would be nice if you showed us the output of `ip route` at the point
> where `ip route add` fails.
> Also `ip route get 136.243.17.1` might give some hints.

# ip route show
default via 136.243.17.1 dev eth0
136.243.17.0/26 via 136.243.17.1 dev eth0
172.16.48.16/28 dev eth0  proto kernel  scope link  src 172.16.48.17

# ip route get 136.243.17.1
136.243.17.1 via 136.243.17.1 dev eth0  src 136.243.17.41
cache

> It totally looks like the gateway you are trying to use is unreachable.

Indeed that's how I also understand the error message. The only thing
I don't understand is what "unreachable" means exactly. I can ping the
gateway just fine and I can reach hosts on the internet (meaning the
gateway is correctly routing my packages). Maybe it means my Linux
kernel doesn't allow sending packets to the gateway with a destination
in the private range 10.180.0.0/24 or with the private source address
172.16.48.17.

> To be honest, I have no idea what does the `mainIPv4  = "136.243.17.41";` line
> do, but feels like it doesn’t configure the routes (or even the address)
> properly.

Nixops will add the mainIPv4 address (136.243.17.41/26) to
networking.interfaces.eth0.ip4 after which the nixos networking module
configures the interface. Nixops will also add the surprising route:

ip -4 route change '136.243.17.0/26' via '136.243.17.1' dev 'eth0'

which is needed because in the Hetzner network it's required to route
all traffic (including traffic to my own subnet) to the gateway. (See:
http://wiki.hetzner.de/index.php/Netzkonfiguration_Debian/en)

Anyway, I'm glad I found a work-around by manually adding the route
without the gateway option.

Cheers,

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


Re: [Nix-dev] Vagrant stuff - images and plugin - still alive?

2015-04-28 Thread Rok Garbas
Quoting Rok Garbas (2015-04-28 09:35:18)
> Quoting Christian Theune (2015-04-25 13:41:19)
> > Hi,
> > 
> > I’ve been working on getting vagrant-based setups working nicely in the last
> > weeks and found
> > 
> > https://github.com/oxdi/vagrant-nixos
> > https://github.com/oxdi/nixos
> > and 
> > https://github.com/zimbatm/nixbox
> > 
> > The zimbatm has images available, I didn’t get around to using the packer
> > templates, yet.
> > 
> > The plugin is nice but is not compatible with NixOS 14.12 in the released
> > version. The code has everything fixed already and just making a release of
> > that code works nicely for me. However, I’d love if the gem would be 
> > publicly
> > available.
> > 
> > So, is anyone on this list using Vagrant with NixOS? Is the author of the
> > plugin still around? Alternatives? Should I fork this and start making
> > releases?
> > 
> 
> Hi Christian,
> 
> I would suggest to create a wiki page about vagrant+nixos to keep all the
> information in one place.
> 
> currently there is only about virtualbox, but vagrant is quickly mentioned at
> the bottom.
> 
> https://nixos.org/wiki/Installing_NixOS_in_a_VirtualBox_guest#Vagrant_boxes
> 

also i found https://github.com/cstrahan/nix-packer


--
Rok Garbas - http://www.garbas.si


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


Re: [Nix-dev] Vagrant stuff - images and plugin - still alive?

2015-04-28 Thread Rok Garbas
Quoting Christian Theune (2015-04-25 13:41:19)
> Hi,
> 
> I’ve been working on getting vagrant-based setups working nicely in the last
> weeks and found
> 
> https://github.com/oxdi/vagrant-nixos
> https://github.com/oxdi/nixos
> and 
> https://github.com/zimbatm/nixbox
> 
> The zimbatm has images available, I didn’t get around to using the packer
> templates, yet.
> 
> The plugin is nice but is not compatible with NixOS 14.12 in the released
> version. The code has everything fixed already and just making a release of
> that code works nicely for me. However, I’d love if the gem would be publicly
> available.
> 
> So, is anyone on this list using Vagrant with NixOS? Is the author of the
> plugin still around? Alternatives? Should I fork this and start making
> releases?
> 

Hi Christian,

I would suggest to create a wiki page about vagrant+nixos to keep all the
information in one place.

currently there is only about virtualbox, but vagrant is quickly mentioned at
the bottom.

https://nixos.org/wiki/Installing_NixOS_in_a_VirtualBox_guest#Vagrant_boxes


--
Rok Garbas - http://www.garbas.si


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


Re: [Nix-dev] Failed to add route because network is unreachable

2015-04-28 Thread Kirill Elagin
It would be nice if you showed us the output of `ip route` at the point
where `ip route add` fails.
Also `ip route get 136.243.17.1` might give some hints.

It totally looks like the gateway you are trying to use is unreachable. To
be honest, I have no idea what does the `mainIPv4  = "136.243.17.41";` line
do, but feels like it doesn’t configure the routes (or even the address)
properly.

On Mon, Apr 27, 2015 at 5:31 PM Bas van Dijk  wrote:

> I just discovered that I can successfully manually add the route if I
> Ieave of the "via " option:
>
> # ip route add  10.180.0.0/24 src 172.16.48.17 dev eth0
>
> After this I can successfully ping hosts on the other side of the VPN!
>
> I'll just settle with adding this to my local networking commands:
>
> networking.localCommands = ''
>ip route add 10.180.0.0/24 src 172.16.48.17 dev eth0 || true
> '';
>
> I do wonder though, why adding that route with a "via "
> option gives the aforementioned error.
>
> Cheers,
>
> Bas
>
> On 27 April 2015 at 15:58, Bas van Dijk  wrote:
> > Dear Nixers,
> >
> > I've a slightly off-topic question but since I know there are some
> > excellent Unix networking experts on this list I hope to get a pointer
> > in the right direction.
> >
> > After some changes in my networking setup (I added an IP address to my
> > eth0 interface) my strongswan VPN service fails to add a route to my
> > routing table (it used to work before):
> >
> > installing route: 10.180.0.0/24 via 136.243.17.1 src 172.16.48.17 dev
> eth0
> > received netlink error: Network is unreachable (101)
> >
> > If I manually try to add the route I get the same error message:
> >
> > # ip route add  10.180.0.0/24 via 136.243.17.1 src 172.16.48.17 dev eth0
> > RTNETLINK answers: Network is unreachable
> >
> > I've asked[1] the same question on the strongswan mailing list but
> > haven't found a solution yet.
> >
> > My network settings are fairly simple (note I'm deploying my machine
> > using nixops to Hetzner):
> >
> >   deployment = {
> > targetEnv = "hetzner";
> > hetzner = {
> >   mainIPv4  = "136.243.17.41";
> >   ...
> > };
> >   };
> >
> >   networking = {
> > enableIPv6 = false;
> > useDHCP = false;
> >
> > interfaces.eth0.ip4 = [
> >   { address = "136.243.25.125"; prefixLength = 32; }
> >   { address = "136.243.25.108"; prefixLength = 32; }
> >   { address = "172.16.48.17";   prefixLength = 28; }
> > ];
> >
> > firewall = {
> >   enable= true;
> >   allowPing = true;
> >   allowedTCPPorts = [ ... ];
> > }
> >   };
> >
> > Any idea why I can't add that route?
> >
> > Regards,
> >
> > Bas
> >
> > [1] https://lists.strongswan.org/pipermail/users/2015-April/007935.html
> ___
> 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