Hi, I recently started using NixOS and made this repository with the steps to install NixOS on my laptop. To sum up my setup I use disko to format the disk, systemd-boot to boot and i3 as window-manager.
I am looking to share it with you and receive some feedback on it! Here is the repo readme, so that you may have an idea of what the steps look like.
# Installation Manual Steps
1. [Download](https://nixos.org/download/#) a NixOS ISO
1. Create bootable device e.g. `sudo dd if=path/to/nixos.iso of=/dev/sdb bs=16M status=progress`
1. Boot in the device and enter the live Nixos
1. Open a root shell `sudo -s`
1. Make sure you have an internet connection
1. For example, `wpa_passphrase <ssid> <pwd> > wifi.conf` and `wpa_supplicant -Dnl80211 -i<wifi-interface> -cwifi.conf`
1. Download the disk configuration `curl https://codeberg.org/jegher/nixos-install-steps/raw/branch/main/disk-config.nix -o disk-config.nix`
1. Replace `/dev/sdb` in the disk config with your main disk
1. Create the encryption key `echo -n 'your_key_here' > /tmp/secret.key`. Note 1) it is not easy to change the disk encryption password so use a secure pass phrase 2) if you edit the file with vim make sure that you remove the newline at the end of the file
1. Make any other change to the disk
1. Format the main disk `nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount ./disk-config.nix`. Warning: this **will destroy any old partition or file system** on the main partition
1. Note: nix may fill all the /nix/store tmpfs use `mount -o remount,size=3G /nix/.rw-store`. 3G should be enough, but you might use more
1. You should find all mounted in `/mnt`
1. Generate the basic configuration `nixos-generate-config --root /mnt`. Note, sometimes the `/etc/nixos/hardware-configuration.nix` generated by this command lacks a trailing `}`, you must open the file and add it at the end
1. Download the main configuration `curl https://codeberg.org/jegher/nixos-install-steps/raw/branch/main/configuration.nix -o /mnt/etc/nixos/configuration.nix`
1. Download the user configuration `curl https://codeberg.org/jegher/nixos-install-steps/raw/branch/main/user-config.nix -o /mnt/etc/nixos/user-config.nix`
1. Edit any configuration in `user-config.nix`, e.g. change `jegher` to your username
1. Edit anything you like in `configuration.nix`
1. Enter the mount `/mnt`, install with `nixos-install -v`
# After install
1. Copy all your configs or files in the `/mnt`
1. For example, `cp path/to/i3/config /mnt/home/user/.config/i3/config`
1. My config files are in this repo under `./files`
1. Enter the OS with `nixos-enter --root /mnt`
1. Change password for your user `passwd <username>`
1. Note, if you put files at step 1 in the user directory they are owned by root
1. So here you might want to `cd /home/user` and `chown -R username:username` any folder or file created as root
1. Now exit the user session, exit the chroot session and reboot or poweroff the system
1. Enjoy NixOS! (if all went well ofc)
# Troubleshooting
1. The configuration uses EFI boot, make sure that your bios (or the vm bios) supports it