Getting Started Installation Guide - bcl1713/nixos GitHub Wiki

Installation Guide

This guide walks you through the complete process of installing and setting up this NixOS configuration.

Prerequisites

Before you begin the installation, ensure you have:

  • A working NixOS installation (if you're new to NixOS, see the NixOS Manual)
  • A user account with sudo privileges
  • Git installed (sudo nix-env -iA nixos.git if not already installed)
  • SSH key for GitHub (needed for agenix secrets)
  • Basic familiarity with the command line

Step-by-Step Installation

1. Clone the Repository

# Create a directory for your configuration
mkdir -p ~/.dotfiles

# Clone the repository
git clone https://github.com/bcl1713/nixos-config.git ~/.dotfiles

# Navigate to the repository
cd ~/.dotfiles

2. Install Home Manager

If you don't already have Home Manager installed, add it to your NixOS configuration:

# In your /etc/nixos/configuration.nix
{
  imports = [ <home-manager/nixos> ];
  
  home-manager.users.yourusername = {
    # Your initial Home Manager configuration
  };
}

Then run:

sudo nixos-rebuild switch

3. Configure Personal Settings

  1. Create or modify the personal profile:
# Edit the flake.nix to set your username and other settings
nvim flake.nix

Look for the userSettings section and modify it to match your information:

userSettings = {
  username = "yourusername";  # Change to your username
  name = "Your Name";         # Change to your name
  email = "[email protected]"; # Change to your email
};
  1. Generate an SSH key if you don't have one:
ssh-keygen -t ed25519 -C "[email protected]"
  1. Set up secrets (optional):
# Create personal-email.age secret
mkdir -p ~/.secrets
echo "[email protected]" > ~/.secrets/personal-email
age -r <your-public-key> ~/.secrets/personal-email > secrets/personal-email.age

4. Apply Configuration

Apply the configuration using the flake:

# Build the system configuration
sudo nixos-rebuild switch --flake ~/.dotfiles/

# Apply the home-manager configuration
home-manager switch --flake ~/.dotfiles/

5. Verify Installation

After installation, verify everything works:

  1. Log out and log back in to ensure all session variables are applied
  2. Launch Hyprland (if using a display manager, select it, or start it manually)
  3. Test key components like Waybar, terminal, and application launcher

Configuration Profiles

The configuration supports different profiles based on your needs:

  • personal - Default configuration for personal use

To switch profiles:

  1. Edit the flake.nix file
  2. Modify the systemSettings variable:
systemSettings = { profile = "personal"; };
  1. Update your configuration using the commands in the "Apply Configuration" section

Post-Installation Setup

First Login

On first login to your new configuration:

  1. Connect to WiFi: Use the wifi-menu utility
  2. Configure Git: Verify git configuration is correct
  3. Initialize Browser: Set up Firefox if you're using it
  4. Set up Passwords: Configure Bitwarden if enabled

Suggested Customizations

Consider these customizations to personalize your setup:

  1. Theme adjustments: Edit colors in waybar and Hyprland
  2. Application preferences: Configure specific applications
  3. Keybindings: Modify key combinations in Hyprland config

Updating the Configuration

To update your configuration with the latest changes:

# Pull the latest changes
cd ~/.dotfiles
git pull

# Apply the changes
sudo nixos-rebuild switch --flake ~/.dotfiles/
home-manager switch --flake ~/.dotfiles/

For major version updates, check the CHANGELOG.md file for breaking changes.

Next Steps