Personal NixOS configuration using flakes and Home Manager for a Lenovo ThinkPad with AMD Ryzen AI 7 PRO 350 (Strix Point) and Radeon 860M graphics. This configuration features modular design, AMD GPU optimizations, and the COSMIC desktop environment.
This configuration is optimized for the following hardware:
| Component | Specification |
|---|---|
| Laptop | Lenovo ThinkPad (21QJCTO1WW) |
| CPU | AMD Ryzen AI 7 PRO 350 (Strix Point) |
| Cores/Threads | 8 cores / 16 threads |
| GPU | AMD Radeon 860M (integrated - RDNA 3.5) |
| RAM | 28 GB |
| Storage | 1TB Micron NVMe SSD (MTFDKBA1T0TGD) |
| Encryption | LUKS full disk encryption |
Note: This is a Ryzen AI 300 series laptop (Strix Point architecture). The AMD optimizations in this config are specifically tuned for this hardware platform.
- Desktop Environment: COSMIC with cosmic-greeter
- Kernel: Latest Linux kernel (6.18+) with AMD-specific optimizations
- Shell: Zsh with powerlevel10k theme
- Editor: Neovim (default) + VSCode
- Terminal: Alacritty with Wayland support
The configuration is split into focused modules for maintainability:
- amd-optimization.nix: GPU/CPU optimizations, TLP power management, hardware acceleration
- desktop.nix: COSMIC desktop, keyboard layouts, Bluetooth, GNOME Keyring integration
- flatpak.nix: Declarative Flatpak management with auto-updates
Uses both stable (25.05) and unstable nixpkgs channels:
- Most packages from stable for reliability
- Select packages (e.g., netbird) from unstable for latest features
Includes a development shell with hardware diagnostics tools:
nix develop .#dev-toolsProvides: lspci, glxinfo, vulkaninfo, stress-ng, and more.
- NixOS installed with flakes enabled
- Git configured with authentication
# Clone the repository
git clone https://github.com/yourusername/nixos-config.git ~/nixos-config
cd ~/nixos-config
# Review and modify configuration files
# Update hardware-configuration.nix for your hardware:
sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
# Set up secrets (if using sops-nix)
# 1. Generate an age key:
age-keygen -o ~/.config/sops/age/keys.txt
# 2. Copy the public key and update secrets/secrets.yaml.example
# 3. Create and encrypt your secrets file:
cp secrets/secrets.yaml.example secrets/secrets.yaml
# Edit with your actual tokens, then encrypt:
sops -e -i secrets/secrets.yaml
# Apply the configuration
sudo nixos-rebuild switch --flake ~/nixos-confignixos-config/
├── flake.nix # Flake configuration and inputs
├── flake.lock # Locked dependency versions
├── configuration.nix # System-level configuration
├── home.nix # User environment (Home Manager)
├── hardware-configuration.nix # Hardware-specific settings
├── modules/
│ ├── amd-optimization.nix # AMD GPU/CPU optimizations
│ ├── desktop.nix # Desktop environment setup
│ └── flatpak.nix # Flatpak package management
├── secrets/
│ ├── .keep # Ensures directory exists
│ └── secrets.yaml.example # Template for encrypted secrets
└── CLAUDE.md # AI assistant instructions
# Update flake inputs
nix flake update
# Apply system changes
sudo nixos-rebuild switch --flake ~/nixos-config
# Or use the custom alias (if shell already configured)
updateSystem packages (configuration.nix):
environment.systemPackages = with pkgs; [
your-package
];User packages (home.nix):
home.packages = with pkgs; [
your-package
];Unstable packages:
# Use pkgs-unstable instead of pkgs
package = pkgs-unstable.your-package;Flatpak applications (modules/flatpak.nix):
packages = [
"com.example.App"
];# Test without making default
sudo nixos-rebuild test --flake ~/nixos-config
# Build for next boot only
sudo nixos-rebuild boot --flake ~/nixos-configThe configuration includes several kernel parameters for GPU stability on Strix Point. Currently active parameters:
- GPU recovery enabled:
amdgpu.gpu_recovery=1 - CWSR disabled:
amdgpu.cwsr_enable=0(fixes Gentoo bug #967078) - VPE disabled via IP block mask:
amdgpu.ip_block_mask=0xfffff7ff(fixes VPE queue reset failures) - IOMMU in passthrough mode:
iommu=pt - AMD P-State active governor:
amd_pstate=active
Optional parameters (currently commented out in modules/amd-optimization.nix):
- Disable runtime PM if suspend/resume issues occur:
amdgpu.runpm=0 - Disable GFX power saving if freezes during idle:
amdgpu.gfx_off=0 - Disable PSR if screen flickering with external displays:
amdgpu.dcdebugmask=0x10
If you experience specific GPU issues, you can uncomment the relevant optional parameters in modules/amd-optimization.nix.
See modules/amd-optimization.nix for complete configuration and detailed comments.
Git credentials managed via:
- libsecret credential helper
- GNOME Keyring (unlocked via PAM at login)
- Seahorse for GUI keyring management
- TLP instead of power-profiles-daemon
- Separate profiles for AC and battery power
- PCIe ASPM forced to performance mode
Hardware diagnostics and stress testing:
nix develop .#dev-toolsIncludes: lspci, glxinfo, vulkaninfo, nvtop, stress-ng, s-tui, mesa-demos
- nixpkgs: NixOS 25.05 stable channel
- nixpkgs-unstable: Latest packages
- home-manager: User environment management
- zen-browser: Privacy-focused browser
- oh-my-tmux: Tmux configuration framework
- solaar: Logitech device manager
- nix-flatpak: Declarative Flatpak management
- sops-nix: Secrets management with age encryption
This is a personal configuration tailored to my specific hardware and workflow. While you're welcome to fork and adapt it for your own use, please note:
- This repo is not accepting pull requests
- Hardware-specific optimizations may not apply to your system
- Always review and test configurations before applying
- The
hardware-configuration.nixis specific to my machine - Secrets are managed with sops-nix and gitignored (use the template to create your own)
- NixOS: 25.05
- Home Manager: 25.05
Important: Do not change state versions without reading the NixOS manual section on state version migration.