Nix 101 Course / Section 1: Getting started: install Nix and score your first wins
Premium

1.7 Nix editor setup: VS Code with nixd and nixfmt

Lesson 7 of 68 · 5:47

placeholder thumbnail

Sign in, then buy this course to watch

Free account · no credit card needed

About this lesson

The Nix language can feel strange at first, and reading it in a plain editor without any support makes that worse. Before the language lessons start, this video sets up Visual Studio Code for Nix: syntax highlighting, code completion, inline documentation and automatic formatting, using the Nix IDE extension, the nixd language server and nixfmt.

In this video

  • Installing the Nix IDE extension, and why syntax coloring alone is not the whole story
  • Wiring up nixd and nixfmt through settings.json, starting from a minimal config that just works
  • Installing both tools with nix profile, including a bash shorthand for adding two packages at once
  • Completion in action: typing packages. and picking real packages from nixpkgs
  • Documentation on mouseover, and where those docs actually come from, plus fixing horribly formatted code with one command

After this lesson

You write Nix with completion, inline documentation and a formatter, which makes everything from here on noticeably more comfortable.

Builds on: Installing tools to keep with nix profile (1.5.2)