Skip to content

Install Nix Package Manager on Your Steam Deck

Your Steam Deck is more than just a gaming device; it’s a powerful PC. When you switch to desktop mode, you can access a plethora of desktop applications from the Discover store. These applications are usually sufficient for most users, but what if you want more? In this guide, we’ll walk you through installing the Nix package manager on your Steam Deck. If you’re not familiar with what a package manager is, let’s start there.

What is a Package Manager?

A package manager is a tool that simplifies managing software packages. This includes installing, updating, and removing software. If you’ve used the Microsoft Store on your PC or the Google Play Store on your smartphone, you have a basic idea of what a package manager does, though they serve other purposes as well. Nix is a prime example of a dedicated package manager. The choice of package manager can greatly influence your system’s reliability, security, and usability. In the Linux world, there are many package managers, each with its own strengths and weaknesses. If you want to learn more about the Nix package manager please check out their official website.

Now that we understand the role of a package manager, let’s dive into installing Nix on your Steam Deck.

Installing Nix on Steam Deck

1. Accessing the Terminal

When you’re in desktop mode, go to the application menu and search for “Konsole”. This is a terminal application that allows you to interact with your system using commands.

Note: When typing a password in the terminal, the number of characters will not be displayed for security reasons.

2. Preparing for Installation

To avoid permission issues with the /nix directory, run the following command:

sudo chown -R deck /nix

3. Running the Install Script

Execute the official install script with this command:

sh <(curl -L https://nixos.org/nix/install) --no-daemon

To verify the installation, check the version:

nix --version

Congratulations! You’ve installed the Nix package manager on your Steam Deck.

4. Installing Software (Visual Studio Code)

Nix boasts an impressive array of over 80,000 packages, but for the purpose of this tutorial, we’ll focus specifically on installing Visual Studio Code. It’s important to note that Visual Studio Code includes proprietary components, classifying it under the unfree licensed software category. By default, Nix does not allow the installation of proprietary licensed software. However, you can override this setting if needed. In our case, we will guide you through the process of enabling the installation of unfree software across the system.

Open a text window in the specified directory:

kate ~/.config/nixpkgs/config.nix

Copy and paste the following snippet into the text editor, and don’t forget to save it:

{
    allowUnfree = true;
}

Now, install Visual Studio Code:

nix-env -iA nixpkgs.vscode

To list all installed software, run:

nix-env -q

By this time, you should be able to launch the application from “Konsole” by calling its name.

code

5. Adding Applications to the Menu

To see applications installed through Nix on the applications menu, run the following steps. Firstly, we need to tell our system that we are expecting application data in the /home/deck/.nix-profile/share directory.

echo 'export XDG_DATA_DIRS="/home/deck/.nix-profile/share"' >> ~/.bashrc

Create a symlink for the desktop file:

ln -s /home/deck/.nix-profile/share/applications/code.desktop ~/.local/share/applications/

Make the file executable:

chmod +x ~/.local/share/applications/code.desktop

You’ll now find Visual Studio Code in your applications menu.

I hope this guide helps you unlock more potential from your Steam Deck. Don’t hesitate to explore other applications available through Nix and tailor your Steam Deck to your needs. If you encounter any issues or have questions, feel free to reach out or consult community forums for assistance.