A kiosk computer implementation. Heavily leans on https://github.com/jamesdury/kiosk-on-a-stick
- Download ISO Image from https://nixos.org/download.html#nixos-iso
- Find USB drive to install to with
lsblk(note this will probably be/dev/sdaor/dev/sdbbut make sure it's the USB drive NOT your hard drive unless you want to have a bad day) - Create USB installation with
dd(note:/dev/sdXshould be changed to your USB drive from previous step) andnixos.isoshould be the path to the nixos iso you downloaded in the first stepsudo dd if=~/Downloads/nixos.iso of=/dev/sdX bs=4M status=progress conv=fdatasync - Startup computer from USB drive by using the BIOS (use F2 during boot)
- Use the sudoer user as all of the following requires root
sudo -s - POINT OF NO RETURN - once the next step is complete, you will no longer have a computer
- Run
fdisk /dev/diskxwherediskxis the hard drive of the computer to partition- For a UEFI partition, the following is slighly different to the nixos.wiki guide as it
includes a SWAP partition (see the youtube link, below)
g(gpt disk label)n1(partition number [1 of 128])2048first sector+500Mlast sector (boot sector size)t1(EFI System)n(swap partition)2(partition number [2 of 128])default(starting sector)+4096M(boot sector size)t219(Linux Swap)n3(partition number [3 of 128])- default (fill up partition)
- default (fill up partition)
w(write - this will wipe the disk)
- For a UEFI partition, the following is slighly different to the nixos.wiki guide as it
includes a SWAP partition (see the youtube link, below)
mkfs.fat /dev/sda1set first partition as FATmkswap /dev/sda2set second partition as SWAPswapon /dev/sda2use second partition SWAPmkfs.ext4 /dev/sda3set third partition as ext4 for linux filesystemcdgo to/mount /dev/sda3 /mntmount linux filesystem on/mntmkdir /mnt/bootmake boot partition foldermount /dev/sda1 /mnt/bootmount boot partition (sda1) on boot partition foldercd /mntnixos-generate-config --root /mntgenerate starting config- you can check the starting config at
/mnt/etc/nixos/configuration.nix nixos-installinstall the configuration.nix start- set the root password for the system
rebootrestart the system to start using it- login with
rootuser unless you added a user in configuration.nix - You may need to fix the permissions on
/bootchmod -R 700 /boot
- https://nixos.wiki/wiki/NixOS_Installation_Guide
- https://www.youtube.com/watch?v=63sSGuclBn0&list=PLuRxZ95-8LY1mlotZMYGYib5sXJRw1RxW&index=1 NOTE this includes a GUI installation AND a manual one at 4:02
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
sudo nix-channel --update