Files
nixos-config/SETUP.md
2025-11-19 08:42:21 +01:00

3.1 KiB

Quick Setup Guide

Initial Setup on Fresh NixOS Installation

nix-shell -p git --run "bash <(curl -s https://git.cribdev.com/raw/YOUR-USERNAME/nixos-config/main/bootstrap.sh)"

Replace YOUR-USERNAME with your actual git username.

Method 2: Manual Setup

  1. Install git temporarily:

    nix-shell -p git
    
  2. Clone your configuration:

    git clone https://git.cribdev.com/YOUR-USERNAME/nixos-config ~/.config/nixos
    cd ~/.config/nixos
    
  3. Copy hardware configuration:

    sudo cp /etc/nixos/hardware-configuration.nix ~/.config/nixos/
    
  4. Edit configuration files:

    • Open flake.nix and replace:

      • myhost with your hostname
      • yourusername with your username
    • Open configuration.nix and set:

      • networking.hostName
      • time.timeZone
      • User account details
    • Open home/home.nix and set:

      • Git username and email
      • Any other personal preferences
  5. Build and apply:

    sudo nixos-rebuild switch --flake ~/.config/nixos#YOURHOSTNAME
    
  6. Reboot:

    reboot
    

Post-Installation

Add a Wallpaper

mkdir -p ~/wallpapers
# Copy your wallpaper to ~/wallpapers/default.jpg

Test Hyprland

After reboot, you should be greeted with a login manager. Log in and Hyprland should start automatically.

Useful First Commands

# Open terminal: SUPER + Return
# Open app launcher: SUPER + D
# Open file manager: SUPER + E

Pushing to Your Git Server

First Time Setup

  1. Initialize git (if not already done):

    cd ~/.config/nixos
    git init
    git add .
    git commit -m "Initial NixOS configuration"
    
  2. Add your remote:

    git remote add origin https://git.cribdev.com/YOUR-USERNAME/nixos-config.git
    
  3. Push to your server:

    git push -u origin main
    

Updating Your Configuration

After making changes:

cd ~/.config/nixos
git add .
git commit -m "Description of changes"
git push

Troubleshooting

"Hardware configuration not found"

Generate it with:

sudo nixos-generate-config --show-hardware-config > ~/.config/nixos/hardware-configuration.nix

"Flake inputs need to be updated"

cd ~/.config/nixos
nix flake update
sudo nixos-rebuild switch --flake .#YOURHOSTNAME

Hyprland doesn't start

Check logs:

journalctl -xe
cat /tmp/hypr/*/hyprland.log

What You Get

Full Wayland desktop with Hyprland Beautiful animations and effects Waybar status bar Wofi application launcher Dunst notifications Screenshot tools (grim + slurp) Modern terminal (Kitty) Essential CLI tools Development environment ready Fully reproducible system

Next Steps

  • Customize Waybar appearance in home/waybar.nix
  • Adjust Hyprland settings in home/hyprland.nix
  • Add more packages in home/home.nix or modules/system.nix
  • Set up your wallpapers
  • Configure your applications

Enjoy your new NixOS + Hyprland setup! 🎉