Updated README.md

This commit is contained in:
2025-11-19 21:09:37 +01:00
parent 53def74fc5
commit 015f7a46f5

335
README.md
View File

@@ -1,166 +1,183 @@
# NixOS Configuration with Hyprland # NixOS Configuration with Hyprland - UPDATED & FIXED
A fully declarative NixOS configuration featuring Hyprland as the Wayland compositor with extensive ricing capabilities. ## 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 ## Features
- **Hyprland**: Modern Wayland compositor with beautiful animations - **NixOS** with Flakes enabled for reproducible builds
- **Home Manager**: User-level package and dotfile management - **Hyprland** - Modern Wayland compositor with beautiful animations
- **Flakes**: Reproducible, declarative configuration - **Home Manager** - Declarative user environment management
- **Full Wayland Support**: Native Wayland applications and XWayland compatibility - **Full Wayland Support** with XWayland fallback
- **Ricing Tools**: Waybar, Hyprpaper, Dunst, and more for customization
- **Development Ready**: Includes essential development tools
## Quick Start (Fresh Install) ### Desktop Environment
- **Waybar** - Highly customizable status bar
- **Wofi** - Application launcher
- **Dunst** - Notification daemon
- **Hyprpaper** - Wallpaper manager
- **SWWW** - Alternative animated wallpaper daemon
On a fresh NixOS installation, run: ### 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 ```bash
nix-shell -p git --run "bash <(curl -s https://git.cribdev.com/raw/your-username/nixos-config/main/bootstrap.sh)" # 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
``` ```
Or manually: 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 ```bash
# Install git # After rebooting into fresh NixOS
nix-shell -p git nix-shell -p git
git clone https://git.cribdev.com/crib/nixos-config.git ~/.config/nixos
# Clone this repository
git clone https://git.cribdev.com/your-username/nixos-config ~/.config/nixos
# Copy hardware configuration
sudo cp /etc/nixos/hardware-configuration.nix ~/.config/nixos/ sudo cp /etc/nixos/hardware-configuration.nix ~/.config/nixos/
# Edit configuration files (see below)
cd ~/.config/nixos cd ~/.config/nixos
# Edit hostname in flake.nix and configuration.nix
# Edit username and other settings
# Build and apply sudo nixos-rebuild switch --flake .#YOUR-HOSTNAME
sudo nixos-rebuild switch --flake .#myhost reboot
``` ```
## Configuration Structure ### 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/ nixos-config/
├── flake.nix # Main flake configuration ├── flake.nix # Main entry point
├── configuration.nix # System-level configuration ├── configuration.nix # System-wide settings
├── hardware-configuration.nix # Auto-generated hardware config ├── hardware-configuration.nix # Hardware-specific settings
├── bootstrap.sh # Bootstrap script for fresh installs
├── modules/ ├── modules/
│ ├── system.nix # System packages and services │ ├── system.nix # System packages and services
│ └── hyprland.nix # Hyprland-specific configuration │ └── hyprland.nix # Hyprland configuration
└── home/ └── home/
├── home.nix # Home Manager user configuration ├── home.nix # User packages and settings
├── hyprland.nix # Hyprland user settings and keybindings ├── hyprland.nix # Hyprland user config & keybindings
└── waybar.nix # Waybar status bar configuration └── waybar.nix # Status bar configuration
``` ```
## Before First Build ## Configuration Checklist
Edit these files with your information: Before first build:
### 1. `flake.nix` - [ ] Edit `flake.nix`: Change hostname from "myhost"
- Replace `myhost` with your hostname - [ ] Edit `configuration.nix`:
- Replace `yourusername` with your username - 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
### 2. `configuration.nix` ## Bootloader Configuration
- Set your `networking.hostName`
- Set your `time.timeZone`
- Adjust locale settings if needed
- Update username in `users.users.yourusername`
### 3. `home/home.nix` ### For UEFI Systems:
- Update `home.username` and `home.homeDirectory` ```nix
- Configure Git with your name and email boot.loader.systemd-boot.enable = true;
- Adjust package list to your needs boot.loader.efi.canTouchEfiVariables = true;
```
### 4. `home/hyprland.nix` ### For BIOS/Legacy Systems (Proxmox default):
- Configure monitor settings ```nix
- Customize keybindings boot.loader.grub.enable = true;
- Adjust animations and appearance boot.loader.grub.device = "/dev/sda";
```
## Included Software **Important:** Make sure your partitioning matches your bootloader choice!
### System Tools
- NetworkManager for networking
- PipeWire for audio
- Bluetooth support
- SSH server
- CUPS for printing
### Desktop Environment
- Hyprland (Wayland compositor)
- Waybar (status bar)
- Wofi (application launcher)
- Dunst (notifications)
- Hyprpaper/SWWW (wallpapers)
### Terminal & Shell
- Kitty & Alacritty terminals
- Zsh with Oh-My-Zsh
- Modern CLI tools (eza, bat, ripgrep, fd, fzf)
### Applications
- Firefox browser
- VSCode editor
- Thunar file manager
- MPV media player
- And more...
## Hyprland Keybindings ## Hyprland Keybindings
Default modifier key: `SUPER` (Windows key) Default modifier key: `SUPER` (Windows key)
### Basic ### Basic
- `SUPER + Return` - Launch terminal (Kitty) - `SUPER + Return` - Terminal (Kitty)
- `SUPER + D` - Launch application launcher (Wofi) - `SUPER + D` - App launcher (Wofi)
- `SUPER + Q` - Close active window - `SUPER + Q` - Close window
- `SUPER + M` - Exit Hyprland - `SUPER + E` - File manager
- `SUPER + E` - Open file manager (Thunar) - `SUPER + V` - Toggle floating
- `SUPER + V` - Toggle floating mode - `SUPER + F` - Fullscreen
- `SUPER + F` - Toggle fullscreen
### Window Management ### Workspaces
- `SUPER + Arrow Keys` - Move focus - `SUPER + 1-9` - Switch workspace
- `SUPER + 1-9` - Switch to workspace
- `SUPER + SHIFT + 1-9` - Move window to workspace - `SUPER + SHIFT + 1-9` - Move window to workspace
- `SUPER + Mouse Left` - Move window
- `SUPER + Mouse Right` - Resize window
### Screenshots ### Screenshots
- `SUPER + SHIFT + S` - Screenshot selection to clipboard - `SUPER + SHIFT + S` - Screenshot to clipboard
- `Print` - Screenshot selection to ~/Pictures - `Print` - Screenshot to ~/Pictures
### Media Keys
- Volume up/down/mute
- Brightness up/down
- All media keys supported
## Customization
### Themes and Appearance
The configuration uses the Catppuccin color scheme by default. To customize:
1. **Waybar**: Edit `home/waybar.nix` - Change colors in the `style` section
2. **Hyprland**: Edit `home/hyprland.nix` - Modify colors in `general` and `decoration` sections
3. **Terminal**: Edit `home/home.nix` - Change Kitty theme and appearance
### Wallpapers
Place your wallpapers in `~/wallpapers/`. The default wallpaper should be `~/wallpapers/default.jpg`.
To change wallpapers on the fly:
```bash
hyprctl hyprpaper wallpaper "monitor,~/wallpapers/your-wallpaper.jpg"
```
### Additional Packages
To add more packages:
**System-wide**: Edit `modules/system.nix` and add to `environment.systemPackages`
**User-level**: Edit `home/home.nix` and add to `home.packages`
## Updating the System ## Updating the System
@@ -168,77 +185,49 @@ To add more packages:
# Update flake inputs # Update flake inputs
nix flake update nix flake update
# Rebuild with new configuration # Rebuild
sudo nixos-rebuild switch --flake ~/.config/nixos#myhost sudo nixos-rebuild switch --flake ~/.config/nixos#YOUR-HOSTNAME
# Or use the alias (after first build) # Or use alias (after first build)
update update
``` ```
## Maintenance
### Garbage Collection
```bash
# Remove old generations older than 7 days
sudo nix-collect-garbage --delete-older-than 7d
# Clean home-manager generations
home-manager expire-generations -7d
```
### Rollback
```bash
# List generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
# Rollback to previous generation
sudo nixos-rebuild switch --rollback
```
## Troubleshooting ## Troubleshooting
### Black screen after login ### Build Errors
- Check if Hyprland is starting: `journalctl -xe`
- Verify graphics drivers are installed
- Check `hardware-configuration.nix` for GPU settings
### Waybar not appearing **"undefined variable 'X'"**
- Restart Waybar: `killall waybar && waybar &` - Package name has changed in newer NixOS
- Check logs: `journalctl --user -u waybar` - Check this fixed config for correct names
### No audio **"wrong type for EFI System Partition"**
- Check PipeWire status: `systemctl --user status pipewire` - Bootloader mismatch - check your partitioning and bootloader config
- Verify audio device: `wpctl status`
### Monitor configuration **"file exists" errors**
Edit `home/hyprland.nix` and adjust the `monitor` setting: - Likely duplicate configuration
```nix - Check for conflicting options in different files
monitor = "DP-1,1920x1080@144,0x0,1";
```
## Useful Commands ### Performance
```bash **Slow first build?**
# Check Hyprland version - Use Hyprland cachix: `nix-shell -p cachix --run "cachix use hyprland"`
hyprctl version - Allocate more RAM/CPU to VM if using Proxmox
# List all windows ## Key Differences from Original Config
hyprctl clients
# Reload Hyprland config This version is specifically updated for:
hyprctl reload - NixOS 25.05 and newer
- Proxmox VMs with legacy BIOS
# View Hyprland logs - Latest package names and APIs
cat /tmp/hypr/$(ls -t /tmp/hypr/ | head -n 1)/hyprland.log - Removed all deprecated options
```
## Resources ## Resources
- [NixOS Manual](https://nixos.org/manual/nixos/stable/) - [NixOS Manual](https://nixos.org/manual/nixos/stable/)
- [Home Manager Manual](https://nix-community.github.io/home-manager/) - [Home Manager Manual](https://nix-community.github.io/home-manager/)
- [Hyprland Wiki](https://wiki.hyprland.org/) - [Hyprland Wiki](https://wiki.hyprland.org/)
- [NixOS Wiki](https://nixos.wiki/) - [NixOS Package Search](https://search.nixos.org/)
## License ## License
Feel free to use and modify this configuration for your own needs. Free to use and modify for your own needs.