How to open a .nix file
Quick, free ways to open Nix on any system.
A .nix file is a Nix Expression File. If double-clicking does nothing, your computer simply does not have an app that reads Nix yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .nix file step by step
- Confirm the file really is a .nix. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with VS Code (Nix IDE), via WSL or any text editor.
- On Mac, use VS Code (Nix IDE) or any text editor.
- On Linux, try VS Code (Nix IDE) or any text editor.
- Still stuck? Search for a dedicated Nix viewer.
Best apps to open .nix files
Windows
- VS Code (Nix IDE), via WSL
- any text editor
macOS
- VS Code (Nix IDE)
- any text editor
Linux
- VS Code (Nix IDE)
- any text editor
!
Before you open it: Caution. Evaluating and building a .nix file can run arbitrary build steps and download sources. Read unfamiliar expressions, especially flakes, before running nix build or nix develop.
Frequently asked questions
Why can't I open my .nix file?
Almost always because no installed app understands Nix. Install one of the apps above, or convert the file to a format your existing software already reads.
What is a flake.nix file?
The modern standard entry point of a Nix project: it declares inputs (pinned dependencies) and outputs (packages, dev shells, systems), making builds fully reproducible.
What is the difference between Nix and NixOS?
Nix is the package manager and language; NixOS is a Linux distribution built on it where the entire system is declared in .nix files.