Skip to content

This repository will contain the instructions for setting up a bootable nixos, which contains a user account as an auto login. The steps are provided in the README.

License

Notifications You must be signed in to change notification settings

esi-neuroscience/nixos-workshop-clients

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nixos-workshop-clients

This repository will contain the instructions and configuration files, for a bootable NixOS.

Important Notes!

As the configuration files are all technically called configuration.nix, this would lead to confusion within the description of the steps performed and which file is used when, along with issues uploading the different configuration files. Therefore for this repository the files will be named configuration_*.nix where the * is the purpose of the configuration, e.g. configuration_iso.nix is the configuration file for creating the iso file of the live nixos.

This README will provide the steps taken to generate an ISO file for a live boot of NixOS from a usb. Then if the laptop that you want to install NixOS as the bootable OS is a UEFI boot you should follow the steps provided in README, alternatively if you want to install the NixOS on a legacy boot laptop, you should follow the steps described in README. There are some slight differences in the steps required, and the configuration files.

You should also always be careful when installing a bootable OS onto your laptop. Make sure anything you want to save from your harddrive is backed up somewhere as the installation on the same disk/partition will wipe all the memory.

Requirements for the configuration file for creating the ISO file.

Nix needs to be installed on the laptop you want to build the ISO file on, as the creation of the ISO file is dependent on the build commands from nix.

sh <(curl -L https://nixos.org/nix/install)>

This provides the nix installation, which you can activate using:

. ~/.nix-profile/etc/profile.d/nix.sh

Now you should have the nix commands available.

For an iso file containing, a basic user account with no root permissions, a second account that does have sudo permissions, an automated login for the basic account, network setup, GNOME, and any specific packages you need, you can use the file configuration_iso.nix as a starting point, which is for a standard setup. Download and save it as configuration.nix.

You can then modify it to fit your needs. The following explained settings are all within the example configuration_iso.nix file. In the example, a basic user account called cobic is defined, you can modify that by changing the line:

users.users.cobic

and change the cobic in the line to be your account name. You can also then setup an initial password for the user if you want, with the auto-login it won't be required but it is useful to have one.

To have the graphical interface and not just a command line interface, you need to include:

services.xserver.enable = true;
services.xserver.desktopManager.gnome.enable = true;

In order to have a network connection, it is best to include the networkmanager option. However you should note that when you set networking.networkmanager.enable = true; then there tends to be a conflict with the networking.wireless.enable option. Therefore it should be in the form:

networking.networkmanager.enable = true;
networking.wireless.enable = false;

Finally for any additional packages that you would like to include in your ISO file you should include them within the environment.systemPackages option. If you don't know whether a package is available or not, you can check from the terminal using:

nix-env -qaP | grep turbovnc

where turbovnc represents the package.

Building the ISO file

Once you have your configuration.nix file designed to suit your needs, you can build the iso image.

Plug in the USB that you want to use for the live boot. You can check the mounted location using

lsblk

It is usually somewhere like /dev/sdb or something similar, it should be clear based on the available memory in comparison to your laptop/computer harddrive.

You can generate the ISO image, in the same directory as where you have the configuration.nix file, using the following command:

NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/74e2faf5965a12e8fa5cff799b1b19c6cd26b0e3.tar.gz nix-shell -p nixos-generators --run "nixos-generate --format iso --configuration ./configuration.nix -o nix_config"

In this case the iso file is symlinked with the name nix_config, which points to the .iso file that is located in the /nix/store directory.

Once you usb is empty, making it the bootable ISO will overwrite everything on it so backup important information, you can unmount the USB.

Warning: make sure you are pointing the following command at your USB!

The location can depend on the system, but before running the command ensure the of= part of the command is pointing to your USB and not your laptop/computer harddrive. You can change /dev/sdb to the location of the USB.

dd if=nix_config/iso/*iso of=/dev/sdb status=progress

This writes the ISO to your USB.

To confirm that everything has been setup, you can run:

sync

For the steps to install the NixOS as the boot system on your additional laptop/computer you need to check if the boot system on the prospective computer is Legacy or or UEFI.

If you have a legacy boot system, you can find the configuration files here and follow the steps in the README linked.

Otherwise if you have a UEFI boot system, you can find the configuraiton files here and follow the steps in the README linked.

About

This repository will contain the instructions for setting up a bootable nixos, which contains a user account as an auto login. The steps are provided in the README.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages