Ever since SteamOS 3.5 added a mutable /nix directory, using the nix package manager to install programs declaritively on the Steam Deck is a game changer. Previously, the immutable file system of SteamOS & their A/B partition scheme meant that installing & configuring programs declaratively using nix wouldn’t survive a SteamOS update.

Sadly, programs that need access to the rdna2 chip in the deck don’t have access to the graphics drivers. We are using nix the package manager, not nix the operating system.

Examples of programs that will need this:

  • Any of the next-gen GPU terminals (alacritty, kitty, ghostty, wezterm).
  • media programs (mpv, vlc).
  • document viewers (zathura).

To fix this, we can use nixgl to wrap these programs so they can access the drivers.

Add the nixgl repo as an input to flake.nix:

{
  description = "My Steam Deck config!";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11-small";

    home-manager.url = "github:nix-community/home-manager/release-24.11";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    nixgl.url = "github:nix-community/nixGL";
    nixgl.inputs.nixpkgs.follows = "nixpkgs";
  };

Apply the nixgl overlay

  outputs = { self, nixpkgs, home-manager, nixgl, ... }: {
    homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [ nixgl.overlay ];
      };
  }:

Using the overlay, we do not have to wrap each individual executable to run our graphical programs. The overlay takes care of that for us.