Nixpkgs: Manual networking on NixOS install

Created on 28 May 2017  路  3Comments  路  Source: NixOS/nixpkgs

I am trying to install NixOS on a virtual machine that is housed on a XenServer.
This means I boot the VM from the NixOS install disk, just like a normal hardware install, but before networking will work I have to manually bridge the network.

On Debian, I would simply edit the /etc/network/interfaces and /etc/resolv.conf files then restart the networking and I would be in business.

But on NixOS, I have no internet connection to start with. I do not know where to find these usual files in order to manual connect the network. If I add them to the configuration file for the installer I've booted into it cannot complete the rebuild as it wants an internet connection to do a nixos-rebuild with my manual network settings.

Any ideas?

My initial settings for Debian came from the server providers tutorial here: http://docs.ovh.ca/en/guides-network-bridging.html

What I'm trying to achieve is the same thing that is achieved in the link above but for NixOS.

Most helpful comment

If you need special packages, building your own iso is also straight forward:

https://github.com/nixos-users/wiki/wiki/Installation-guide#build-a-custom-installation-image

All 3 comments

You can use nixos-rebuild without internet connection like this:

# source: https://github.com/nixos-users/wiki/wiki/FAQ#how-can-i-disable-the-binary-cache-and-build-everything-locally
nixos-rebuild switch --option binary-caches ""

This of course assumes, that no new packages are installed.
Apart from that you should have also access to dhcpcd and ip to manually configure the network.

If you need special packages, building your own iso is also straight forward:

https://github.com/nixos-users/wiki/wiki/Installation-guide#build-a-custom-installation-image

Following the linux ip guide here: http://linux-ip.net/html/basic-changing.html
I got nixos connected to the internet manually using ifconfig and ip

Was this page helpful?
0 / 5 - 0 ratings