234 lines
6.2 KiB
Markdown
234 lines
6.2 KiB
Markdown
# NixOS Configuration with Hyprland - UPDATED & FIXED
|
|
|
|
## What's Different in This Version
|
|
|
|
This is an **updated version** with all the fixes for compatibility with NixOS 25.05 and newer:
|
|
|
|
### Fixed Issues:
|
|
- ✅ Updated `hardware.opengl` → `hardware.graphics`
|
|
- ✅ Removed deprecated `sound.enable`
|
|
- ✅ Fixed `hardware.pulseaudio` → `services.pulseaudio`
|
|
- ✅ Updated font packages: `nerdfonts` → `nerd-fonts.*`
|
|
- ✅ Updated font names: `noto-fonts-cjk` → `noto-fonts-cjk-sans`
|
|
- ✅ Fixed package names: `thunar` → `xfce.thunar`
|
|
- ✅ Fixed Qt packages: `qt5ct` → `libsForQt5.qt5ct`, `qt6ct` → `kdePackages.qt6ct`
|
|
- ✅ Updated Git config API: `userName/userEmail` → `settings.user.name/email`
|
|
- ✅ Updated Kitty API: `theme` → `themeFile`
|
|
- ✅ Removed duplicate XDG portal configuration (handled by Hyprland module)
|
|
- ✅ Configured for both UEFI and BIOS/Legacy boot
|
|
|
|
## Features
|
|
|
|
- **NixOS** with Flakes enabled for reproducible builds
|
|
- **Hyprland** - Modern Wayland compositor with beautiful animations
|
|
- **Home Manager** - Declarative user environment management
|
|
- **Full Wayland Support** with XWayland fallback
|
|
|
|
### Desktop Environment
|
|
- **Waybar** - Highly customizable status bar
|
|
- **Wofi** - Application launcher
|
|
- **Dunst** - Notification daemon
|
|
- **Hyprpaper** - Wallpaper manager
|
|
- **SWWW** - Alternative animated wallpaper daemon
|
|
|
|
### Tools & Applications
|
|
- **Kitty & Alacritty** - Modern GPU-accelerated terminals
|
|
- **ZSH** with Oh-My-Zsh - Enhanced shell experience
|
|
- **Firefox** - Web browser
|
|
- **VSCode** - Code editor
|
|
- **Thunar** - File manager
|
|
- **Modern CLI tools** - ripgrep, fd, bat, eza, fzf, etc.
|
|
|
|
## Quick Start
|
|
|
|
### Method 1: Fresh NixOS Install (Two-Phase)
|
|
|
|
**Phase 1: Install Base NixOS**
|
|
|
|
1. Boot NixOS ISO
|
|
2. Partition and format disk:
|
|
```bash
|
|
# For BIOS/Legacy (like Proxmox with legacy BIOS)
|
|
parted /dev/sda -- mklabel gpt
|
|
parted /dev/sda -- mkpart primary 1MiB 2MiB
|
|
parted /dev/sda -- set 1 bios_grub on
|
|
parted /dev/sda -- mkpart primary 2MiB 512MiB
|
|
parted /dev/sda -- mkpart primary 512MiB 100%
|
|
|
|
mkfs.fat -F 32 -n boot /dev/sda2
|
|
mkfs.ext4 -L nixos /dev/sda3
|
|
|
|
mount /dev/disk/by-label/nixos /mnt
|
|
mkdir -p /mnt/boot
|
|
mount /dev/disk/by-label/boot /mnt/boot
|
|
```
|
|
|
|
3. Generate and edit config:
|
|
```bash
|
|
nixos-generate-config --root /mnt
|
|
nano /mnt/etc/nixos/configuration.nix
|
|
# Add bootloader config (see configuration.nix for example)
|
|
```
|
|
|
|
4. Install and reboot:
|
|
```bash
|
|
nixos-install
|
|
reboot
|
|
```
|
|
|
|
**Phase 2: Apply Custom Configuration**
|
|
|
|
```bash
|
|
# After rebooting into fresh NixOS
|
|
nix-shell -p git
|
|
git clone https://git.cribdev.com/crib/nixos-config.git ~/.config/nixos
|
|
sudo cp /etc/nixos/hardware-configuration.nix ~/.config/nixos/
|
|
|
|
cd ~/.config/nixos
|
|
# Edit hostname in flake.nix and configuration.nix
|
|
# Edit username and other settings
|
|
|
|
sudo nixos-rebuild switch --flake .#YOUR-HOSTNAME
|
|
reboot
|
|
```
|
|
|
|
### Method 2: Direct Install with Flake (Advanced)
|
|
|
|
From the ISO after partitioning:
|
|
|
|
```bash
|
|
nix-shell -p git
|
|
git clone https://git.cribdev.com/crib/nixos-config.git /mnt/etc/nixos
|
|
nixos-generate-config --root /mnt --show-hardware-config > /mnt/etc/nixos/hardware-configuration.nix
|
|
|
|
# Edit configs
|
|
nano /mnt/etc/nixos/flake.nix
|
|
nano /mnt/etc/nixos/configuration.nix
|
|
|
|
# Install with flake
|
|
nixos-install --flake /mnt/etc/nixos#YOUR-HOSTNAME
|
|
reboot
|
|
```
|
|
|
|
## File Structure
|
|
|
|
```
|
|
nixos-config/
|
|
├── flake.nix # Main entry point
|
|
├── configuration.nix # System-wide settings
|
|
├── hardware-configuration.nix # Hardware-specific settings
|
|
│
|
|
├── modules/
|
|
│ ├── system.nix # System packages and services
|
|
│ └── hyprland.nix # Hyprland configuration
|
|
│
|
|
└── home/
|
|
├── home.nix # User packages and settings
|
|
├── hyprland.nix # Hyprland user config & keybindings
|
|
└── waybar.nix # Status bar configuration
|
|
```
|
|
|
|
## Configuration Checklist
|
|
|
|
Before first build:
|
|
|
|
- [ ] Edit `flake.nix`: Change hostname from "myhost"
|
|
- [ ] Edit `configuration.nix`:
|
|
- Set hostname
|
|
- Choose bootloader (GRUB for BIOS or systemd-boot for UEFI)
|
|
- Set timezone
|
|
- Update username from "crib" if needed
|
|
- [ ] Edit `home/home.nix`:
|
|
- Confirm username is correct
|
|
- Set git name and email
|
|
- Customize package list
|
|
|
|
## Bootloader Configuration
|
|
|
|
### For UEFI Systems:
|
|
```nix
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
```
|
|
|
|
### For BIOS/Legacy Systems (Proxmox default):
|
|
```nix
|
|
boot.loader.grub.enable = true;
|
|
boot.loader.grub.device = "/dev/sda";
|
|
```
|
|
|
|
**Important:** Make sure your partitioning matches your bootloader choice!
|
|
|
|
## Hyprland Keybindings
|
|
|
|
Default modifier key: `SUPER` (Windows key)
|
|
|
|
### Basic
|
|
- `SUPER + Return` - Terminal (Kitty)
|
|
- `SUPER + D` - App launcher (Wofi)
|
|
- `SUPER + Q` - Close window
|
|
- `SUPER + E` - File manager
|
|
- `SUPER + V` - Toggle floating
|
|
- `SUPER + F` - Fullscreen
|
|
|
|
### Workspaces
|
|
- `SUPER + 1-9` - Switch workspace
|
|
- `SUPER + SHIFT + 1-9` - Move window to workspace
|
|
|
|
### Screenshots
|
|
- `SUPER + SHIFT + S` - Screenshot to clipboard
|
|
- `Print` - Screenshot to ~/Pictures
|
|
|
|
## Updating the System
|
|
|
|
```bash
|
|
# Update flake inputs
|
|
nix flake update
|
|
|
|
# Rebuild
|
|
sudo nixos-rebuild switch --flake ~/.config/nixos#YOUR-HOSTNAME
|
|
|
|
# Or use alias (after first build)
|
|
update
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Build Errors
|
|
|
|
**"undefined variable 'X'"**
|
|
- Package name has changed in newer NixOS
|
|
- Check this fixed config for correct names
|
|
|
|
**"wrong type for EFI System Partition"**
|
|
- Bootloader mismatch - check your partitioning and bootloader config
|
|
|
|
**"file exists" errors**
|
|
- Likely duplicate configuration
|
|
- Check for conflicting options in different files
|
|
|
|
### Performance
|
|
|
|
**Slow first build?**
|
|
- Use Hyprland cachix: `nix-shell -p cachix --run "cachix use hyprland"`
|
|
- Allocate more RAM/CPU to VM if using Proxmox
|
|
|
|
## Key Differences from Original Config
|
|
|
|
This version is specifically updated for:
|
|
- NixOS 25.05 and newer
|
|
- Proxmox VMs with legacy BIOS
|
|
- Latest package names and APIs
|
|
- Removed all deprecated options
|
|
|
|
## Resources
|
|
|
|
- [NixOS Manual](https://nixos.org/manual/nixos/stable/)
|
|
- [Home Manager Manual](https://nix-community.github.io/home-manager/)
|
|
- [Hyprland Wiki](https://wiki.hyprland.org/)
|
|
- [NixOS Package Search](https://search.nixos.org/)
|
|
|
|
## License
|
|
|
|
Free to use and modify for your own needs.
|