my collection of dot files for building my nixos systems.
The installation process is in 2 stages:
- installing minimal system
- installing system & user configuration
This step requires the minimal NixOs image. Options are:
- download the minimal image
- build the minimal image
Simply follow the steps in NixOs user-guide
First, write the following in to a file named custom-media.nix:
{ pkgs, modulesPath, ... }: {
imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix"
];
boot.kernelPackages = pkgs.linuxPackages_latest;
}
Then enter a nix-shell with nixos-generators and build the media:
nix-shell -p nixos-generators
nix-shell$ nixos-generate -I nixpkgs=channel:nixos-unstable --format iso --configuration ./custom-media.nix
Finally copy the ISO to USB disk, on my system its /dev/sda
.
Note: the sync at the end is critical.
$ sudo cp /nix/store/gnnbjvd916yh1f4svbgrssq94550pbxl-nixos-21.11pre304626.8ecc61c91a5-x86_64-linux.iso/iso/nixos-21.11pre304626.8ecc61c91a5-x86_64-linux.iso /dev/sda
$ sudo sync
- Disable RAID mode
Follow the NixOs Chapter2 user-guide
For my system, I used swap file in favor of swap partition.
To configure the system:
git clone git@github.com:kayvank/dotfiles.git ~/.config/dotfiles
cd ~/.config/dotfiles
- Installing system configurations:
./apply-system ## installs system configs
./update
- Installing user configurations:
cd ~/.config/dotfiles
./apply-user.sh ## installs user configs
./update
The main idea for this repo is from: