Skip to content

Latest commit

 

History

History
114 lines (79 loc) · 2.47 KB

INSTALL.md

File metadata and controls

114 lines (79 loc) · 2.47 KB

TODO: This file needs to be updated now that I am using Nix flakes. See other TODO below

Install From Scratch on a NixOS System

  1. Set partitions and filesystems

    TODO: Give disko a try.

  2. 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

TODO: Try to go directly with Nix flakes with:

sudo nixos-rebuild switch --flake github:dmarcoux/dotfiles#HOSTNAME
  1. 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
  1. Find and comment out the various secrets imports in the root home-manager and NixOS Nix files (The repository with secrets isn't cloned yet)
grep -rni "secrets" *
  1. 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
  1. Install NixOS
sudo nixos-install
  1. Reboot
reboot

  1. Log in as root with the password set in the NixOS installation

  2. Open a terminal and set password for my user

passwd dany
  1. Log out
logout
  1. Log in as my user

  2. Clone the dotfiles repository

git clone [email protected]:dmarcoux/dotfiles.git ~/dotfiles
  1. Setup secrets gitsubmodule
cd dotfiles &&
git submodule init &&
git submodule update &&
cd secrets &&
echo "Follow instructions from the Setup section in secrets' README"
  1. 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
  1. Build the NixOS system
sudo nixos-rebuild boot
  1. Reboot
reboot
  1. Clean up /etc/nixos to remove everything but /etc/nixos/configuration.nix