-
Set partitions and filesystems
TODO: Give disko a try.
-
Mount partitions and create directory for NixOS configuration files
sudo mount /dev/disk/by-label/nixos /mnt &&
sudo mkdir -p /mnt/boot /mnt/etc/nixos &&
sudo mount /dev/disk/by-label/boot /mnt/boot
sudo nixos-rebuild switch --flake github:dmarcoux/dotfiles#HOSTNAME
- Download this repository as a ZIP archive and extract its content in /mnt/etc/nixos/dotfiles
(with
-L
,curl
follows redirects)
cd /mnt/etc/nixos &&
sudo curl -L https://github.com/dmarcoux/dotfiles/archive/refs/heads/main.zip --output dotfiles.zip &&
sudo unzip dotfiles.zip &&
sudo mv dotfiles-main dotfiles
- Find and comment out the various
secrets
imports in the roothome-manager
andNixOS
Nix files (The repository with secrets isn't cloned yet)
grep -rni "secrets" *
- Symlink one of the host configurations to
/mnt/etc/nixos/configuration.nix
sudo rm /mnt/etc/nixos/configuration.nix &&
sudo ln --symbolic /mnt/etc/nixos/dotfiles/hosts/CHOOSE_HOST/configuration.nix /mnt/etc/nixos/configuration.nix
- Install NixOS
sudo nixos-install
- Reboot
reboot
-
Log in as
root
with the password set in the NixOS installation -
Open a terminal and set password for my user
passwd dany
- Log out
logout
-
Log in as my user
-
Clone the dotfiles repository
git clone [email protected]:dmarcoux/dotfiles.git ~/dotfiles
- Setup
secrets
gitsubmodule
cd dotfiles &&
git submodule init &&
git submodule update &&
cd secrets &&
echo "Follow instructions from the Setup section in secrets' README"
- Symlink one of the host configurations to
/etc/nixos/configuration.nix
(the default path to the main NixOS configuration module). Create one if not already done. The generated hardware-configuration.nix is under /etc/nixos.
sudo rm /etc/nixos/configuration.nix &&
sudo ln --symbolic "/home/dany/dotfiles/hosts/CHOOSE_HOST/configuration.nix" /etc/nixos/configuration.nix
- Build the NixOS system
sudo nixos-rebuild boot
- Reboot
reboot
- Clean up
/etc/nixos
to remove everything but/etc/nixos/configuration.nix