Skip to content

NixOS flake configuration for Lenovo ThinkPad with AMD Ryzen AI 7 PRO 350 (Strix Point) and Radeon 860M. Features modular design, AMD GPU optimizations, COSMIC desktop, and Home Manager integration.

Notifications You must be signed in to change notification settings

juriSacchetta/nixos-config

Repository files navigation

NixOS Configuration for AMD Ryzen AI 7 PRO 350 (Strix Point)

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.

Hardware Specifications

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.

Software Environment

  • 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

Features

Modular Architecture

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

Dual Channel Setup

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

Development Tools

Includes a development shell with hardware diagnostics tools:

nix develop .#dev-tools

Provides: lspci, glxinfo, vulkaninfo, stress-ng, and more.

Quick Start

Prerequisites

  • NixOS installed with flakes enabled
  • Git configured with authentication

Clone and Apply

# 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-config

Configuration Structure

nixos-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

Common Tasks

Updating the System

# 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)
update

Adding Packages

System 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"
];

Testing Changes

# Test without making default
sudo nixos-rebuild test --flake ~/nixos-config

# Build for next boot only
sudo nixos-rebuild boot --flake ~/nixos-config

Key Technical Details

AMD GPU Stability

The 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.

Credential Management

Git credentials managed via:

  • libsecret credential helper
  • GNOME Keyring (unlocked via PAM at login)
  • Seahorse for GUI keyring management

Power Management

  • TLP instead of power-profiles-daemon
  • Separate profiles for AC and battery power
  • PCIe ASPM forced to performance mode

Development Shells

dev-tools

Hardware diagnostics and stress testing:

nix develop .#dev-tools

Includes: lspci, glxinfo, vulkaninfo, nvtop, stress-ng, s-tui, mesa-demos

Flake Inputs

  • 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

Notes

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.nix is specific to my machine
  • Secrets are managed with sops-nix and gitignored (use the template to create your own)

State Versions

  • NixOS: 25.05
  • Home Manager: 25.05

Important: Do not change state versions without reading the NixOS manual section on state version migration.

Resources

About

NixOS flake configuration for Lenovo ThinkPad with AMD Ryzen AI 7 PRO 350 (Strix Point) and Radeon 860M. Features modular design, AMD GPU optimizations, COSMIC desktop, and Home Manager integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •