nixos-install from CD should not require network access #85

Closed
fare opened this Issue Feb 7, 2013 · 27 comments

Comments

Projects
None yet
8 participants

fare commented Feb 7, 2013

A CD-based installation should NOT require network access.

Currently, it downloads plenty of stuff from the network.

Member

shlevy commented Feb 7, 2013

The problem with this is knowing what packages to include in the cd to ensure a networkless install. Not an insurmountable problem, but someone has to make that decision and maintain the list. And of course users wouldn't be able to expect to be able to update the nix channel before installing.

One thing that will help regardless though is making sure stdenv is present (maybe not in the minimal CD, but possibly in the graphical one or some new one). That way, you'll be able to build simple packages like new systemd units without downloading anything.

fare commented Feb 7, 2013

Being able to install WICD and/or NetworkManager without having network access (yet) would be very useful.

fare commented Feb 7, 2013

Also, having a channel and a cache of pre-downloaded packages on the boot CD would help a lot.

Member

shlevy commented Feb 7, 2013

I believe the graphical CD has networkmanager. The CD has a channel already, if you want pre-downloaded packages (whether that means just tarballs or fully built) is trivial once you have a list of packages.

fare commented Feb 7, 2013

Is there a tutorial on how to build an install image with a given list of packages, and how to actually install all these things from the USB drive, without network access during install (but for opportunistic access afterwards)?

Member

shlevy commented Feb 7, 2013

See http://hydra.nixos.org/build/4010702/download/1/nixos/manual.html#idp368240 for instructions on building your own livecd (the example uses modules/installer/cd-dvd/installation-cd-minimal.nix, but you can use a configuration that extends it). So if you want a given package to be added to the CD, simply add it to environment.systemPackages.

fare commented Feb 8, 2013

I haven't tried building my livecd yet. But from the distributed graphical livecd, nixos-install definitely tries to download plenty of stuff, including stuff I didn't explicitly ask for, which is a bug. Like, for instance, thunar.

fare commented Feb 13, 2013

I retried again with a minimally modified configuration.nix, to make sure it wasn't my modifications causing all the downloading.

Even changing only the block devices, it downloads at least the glibc-locales-2.13. Sucks. :-(

fare commented Feb 13, 2013

Many packages were downloaded, but I failed to redirect output to a file and save the list. Also included was busybox and more. Interestingly, the install eventually failed with /mnt/mnt being mounted.

fare commented Feb 13, 2013

(side note: you should sync at some point before reboot and around it write messages warning the user that this can take a while)

ebzzry commented Feb 13, 2013

I should also note that the manual that shlevy pointed out is a bit outdated. References to /etc/nixos/nixos/ should be changed to /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/, unless I am missing something out.

fare commented Feb 14, 2013

Relatedly or not, some failed attempts to install resulted in a state where /mnt/mnt was mounted, and other such weirdnesses. Maybe it's such confusion that was causing nix to do extraneous downloading. Hard to tell without starting from scratch again. Sigh.

Member

vcunat commented Feb 14, 2013

In your place I would build the whole system (configuration.nix) on a machine with internet access, and then imported its closure into the newly-installed machine (just during installation).

Member

viric commented Feb 14, 2013

On Wed, Feb 13, 2013 at 05:05:40PM -0800, François-René Rideau wrote:

Relatedly or not, some failed attempts to install resulted in a state where /mnt/mnt was mounted, and other such weirdnesses. Maybe it's such confusion that was causing nix to do extraneous downloading. Hard to tell without starting from scratch again. Sigh.

This can happen if you had some shell inside some of the pieces, and then,
nixos-install at exit can't umount. Or if you ctrl-c nixos-install too much.

Could it be any of these cases?

fare commented Feb 14, 2013

I probably had a shell with its current directory as /mnt/etc/nixos indeed, in which I had been editing the configuration.

As for the nix-copy-closure, well, it's a great idea, but doesn't solve the issue of the initial network-less bootstrap.

Member

vcunat commented Feb 15, 2013

I didn't mean nix-copy-closure, as you would need network for that. Code like nix-store --export $(nix-store -qR system-path) > file-on-external-drive and then nix-store --import file. You will still need some initial bootstrap with that, but you probably don't have to change configuration.nix at all. (Otherwise you can also copy the entire drive contents :-)

fare commented Feb 15, 2013

Maybe duplicating the bootstrap image from CD and/or key should be one of the supported options to install NixOS.

fare commented Feb 15, 2013

It's not immediately obvious which things to include (besides /nix/store) and which things to leave out (besides mounted things).

Member

shlevy commented Feb 15, 2013

Did you try my recommendation of ensuring stdenv is on the CD? That should eliminate downloading if your configuration doesn't need any programs not on the CD.

Owner

edolstra commented Feb 15, 2013

FWIW, NixOS is not intended to support a network-less installation.

However, for a sufficiently minimal install, it is possible by including a few more packages on the installation CD. See nixos/tests/installer.nix (which performs an automated network-less install).

fare commented Feb 15, 2013

Could these extra packages be included on the default installation CD ?

@shlevy @edolstra I am doing some installation testing for various partitioning schemes using nixos-graphical-16.03.503.3f96280-x86_64-linux.iso . Not doing anything interesting, two disk raid root partition, fdisk, etc. and am seeing the following repeatedly pulled from the network.

https://gist.github.com/seanjensengrey/549af54ccb45c187aeaa60d5ac7a91b5

I am super new to Nix, but is there a way for me to merge these into the CD image or provide a local mirror?

Member

vcunat commented Apr 6, 2016

Note: this repository is obsolete and you should use https://github.com/NixOS/nixpkgs instead.

There is a way. Probably not well documented, but maybe this can point you in the right direction: https://nixos.org/wiki/Creating_a_NixOS_live_CD#adding_additional_software_to_the_image

Great. I'll checkout the link. I didn't set any repos, just what was preconfigured in the above .iso

My configuration.nix https://gist.github.com/seanjensengrey/b69ffddbc668e127b1946d4c147e0bcb

Owner

domenkozar commented May 20, 2016

Nothing actionable here. We provide minimal cd with a explicit purpose of being minimal. We can't ship all software on it.

domenkozar closed this May 20, 2016

seanjensengrey commented May 21, 2016 edited

No one asked for 'all software', just an install ISO that doesn't pull from the network in the base case.

How does one go about building their own ISO with extra packages? https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/installer.nix is a start

In my case it is 22 packages, like sudoers, sudo, udev-rules, etc. It is all in the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment