Introduction

Dashboard

We’ll install Hyprland through Nix, this guide will assume we’re already familiar with Arch Linux and Nix.

  • Why not through pacman?

Valve creates a snapshot of Arch Linux’ repository every version or so, you can expect the repository to have a lot of old packages, we’ll not go through that.

Besides, I’m not attempting to make major changes to the rootfs.

  • What about building the packages in SteamOS?

Hyprland and commonly-used wlroots tools are hard to build or run with the old libraries shipped in the SteamOS, I’ve attempted this by replicating SteamOS environment and build what I need, but turns out there are a lot of things that needs to be updated, not just the wayland-related libs, but also GCC libs, which is something I’d avoid to mess.

  • What about distrobox?

Distrobox is definitely my go to for installing stuffs in SteamOS, but a Window Manager is not one of them.

Using home-manager in Nix

I’ll assume you’ve installed Nix with home-manager, if not, go to these resources:

  1. Nix single-user installation guide
  2. home-manager standalone installation guide

You’d also need nixGL because applications in Nix packages are not build with conventional library paths.

Installing Hyprland

Modify your ~/.config/home-manager/home.nix:

{ config, pkgs, ... }:

{
  # ... Your stuffs here ...
  home.packages = [
    pkgs.hyprland
  ];

  home.sessionVariables = {
    LOCALES_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
  };

  # ... Your stuffs here ...
}

It’s worth noting that you can use wayland.windowManager.hyprland.enable, which will also make home-manager manage you Hyprland dotfiles, it’s just my preference to use Nix only as package manager.

Locale stuffs

Generate your preferred locale:

sudo steamos-readonly disable
sudo vim /etc/locale.gen        # Enable your locale
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --populate holo
sudo pacman -S glibc
sudo locale-gen
sudo localectl set-locale $YOUR_LOCALE
sudo steamos-readonly enable

SteamOS is slimmed down by removing headers and other files, which sometimes triggers pacman complaining about missing files when installing stuffs, which is why we’re attempting to reinstall glibc.

Picking a tty for running Hyprland

I was unable to make Hyprland running in the Gaming Mode, there are few Reddit posts where they’re showcasing Hyprland in the Gaming Mode, but there are few issues, and nested WM doesn’t seem to worth the trouble.

So what we would do here is to run Hyprland directly in another tty, the way it intended.

Open Steam in desktop mode, and create a non-steam game application from this desktop file:

[Desktop Entry]
Name=Hyprland
Exec=/usr/bin/sudo /home/deck/init.sh
Comment=
Terminal=false
Icon=gnome-panel-launcher
Type=Application

Create ~/init.sh:

#!/bin/sh

chvt 4
systemctl stop sddm

And sudoers rule /etc/sudoers.d/zz-hyprland:

%wheel ALL=(root) NOPASSWD: /home/deck/init.sh

Here, we picked /dev/tty4 to run Hyprland, but why do we want to stop sddm? stopping sddm is the least destructive way of stopping the Game mode without changing any scripts Valve made to run Steam.

Configure Autologin in tty

Create file /etc/systemd/system/[email protected]/autologin.conf:

[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin deck %I $TERM

And add this to your .bashrc

if [[ "$(tty)" == "/dev/tty4" ]]; then
    source ~/.nix-profile/etc/profile.d/hm-session-vars.sh
    nixGL Hyprland
fi

Running Hyprland

You should be good to go now! Go back to the gaming mode, go to non-Steam section in your Library and run it.

Issues

  1. Starting back sddm can freeze tty1 sometimes, not sure why, so if you’re already in Hyprland, you can’t really go back to Gaming mode. You’ll need to reboot.
  2. Do no run Steam in Hyprland, it will deactivate Lizard Mode and as of now, Steam isn’t able to control Wayland environment other than KDE and GNOME.

Just showcasing my Hyprdose rice :) .

Hyprland Keyboard Showcase Steam Gaming Mode