[Nix-dev] Question about chroot & nixos-install

Denis Paukaev dpaukaev at ptsecurity.com
Fri Apr 1 14:32:17 CEST 2016


Hi!

I would like to use 'nixos-install' to generate a chroot from another
linux (such as Ubuntu), but also using a nixpkgs checkout of my choice.

'nixos-install' though has a problem..

> srcs=$(nix-env "${extraBuildFlags[@]}" -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")
> if test -n "$srcs"; then
>   echo "copying NixOS/Nixpkgs sources..."
>   chroot $mountPoint /nix/store/nh2kih74f47fhnbf2bg5q49vi2f9jq8l-nix-1.10/bin/nix-env \
>                      "${extraBuildFlags[@]}" -p /nix/var/nix/profiles/per-user/root/channels -i "$srcs" --quiet
> fi

Here it looks for a package called 'nixos' in the manifest.nix
located in '/nix/var/nix/profiles/per-user/root/channels',
and installs it in chroot.

But when used outside of NixOS, only 'nix' is installed and I haven't
got the 'nixos' channel.  Of course I can add the 'nixos' channel, but it
wouldn't allow me to use my 'nixpkgs' in this place.

Now the question is -- how can this problem be solved???
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160401/4511672c/attachment-0001.html 


More information about the nix-dev mailing list