Main

This is my main desktop workstation running NixOS.

Hardware

  • CPU: AMD
  • GPU: NVIDIA RTX 5060 Ti
  • Platform: x86_64-linux

Services

{pkgs, inputs, ...}:{
  programs = {
    # KDE Partition Manager
    partition-manager.enable = true;
  };

  services = {
    openssh.enable = true;
    xserver = {
      enable = true;
      xkb = {
        layout = "us";
        variant = "";
      };
    };
    xserver.videoDrivers = ["nvidia"];
    
    # KDE Plasma 6 - Start with X11 for better NVIDIA compatibility
    displayManager.sddm = {
      enable = true;
      # Disable Wayland for now due to NVIDIA
      wayland.enable = false;
    };
    
    # Set default session to X11
    displayManager.defaultSession = "plasma";
    
    desktopManager.plasma6.enable = true;
    
    printing.enable = false;
    pulseaudio.enable = false;
    geoclue2.enable = true;
    pipewire = {
      enable = true;
      alsa = {
        enable = true;
        support32Bit = true;
      };
      pulse.enable = true;
    };
  };

  # XDG Portal configuration for KDE
  xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [
      kdePackages.xdg-desktop-portal-kde
      xdg-desktop-portal-gtk
    ];
  };
  
  # Environment variables for NVIDIA with KDE
  environment.sessionVariables = {
    # NVIDIA
    LIBVA_DRIVER_NAME = "nvidia";
    GBM_BACKEND = "nvidia-drm";
    __GLX_VENDOR_LIBRARY_NAME = "nvidia";
    # Disable hardware cursor for NVIDIA (can cause black screen)
    WLR_NO_HARDWARE_CURSORS = "1";
  };
}

Hardware Configuration

{ lib, config, ... }:
{
  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware = {
    enableRedistributableFirmware = lib.mkDefault true;
    cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
    bluetooth = {
      enable = true;
      powerOnBoot = true;
    };
    graphics.enable = true;
    nvidia = {
      modesetting.enable = true;
      powerManagement.enable = false;
      powerManagement.finegrained = false;
      open = false;
      nvidiaSettings = true;
      package = config.boot.kernelPackages.nvidiaPackages.stable;
      
      # Force full composition pipeline to prevent screen tearing
      forceFullCompositionPipeline = true;
    };
  };
}
  • See the gaming section in the notebook for how I use this machine for gaming
  • See the nixos section in the notebook for how this configuration is structured