How to install Claude Code on NixOS via Nix
A NixOS user shared how to get Claude Code running through the Nix package manager. The standard npm install method doesn't work well on NixOS, so this post covers a workaround. Useful for developers who run NixOS as their system.
Claude Code normally installs via npm, but NixOS is a special Linux distribution that manages system files in a fixed, immutable way — standard installations often break or require extra steps. This post walks through how to install and run Claude Code properly using the Nix package system instead.
NixOS has a smaller user base, but developers who use it tend to care a lot about reproducible environments — meaning they can recreate their exact setup from a single config file. Installing Claude Code through Nix fits that workflow, letting you track it alongside the rest of your system configuration.
Key points
- Standard npm install of Claude Code doesn't work as-is on NixOS
- Using Nix to install Claude Code lets you manage it like any other system package
- Your entire dev environment, including Claude Code, can be reproduced from one config file on NixOS
Quick term guide
- share
- A server folder made available to apps or other devices.
- package manager
- A tool that helps install, update, and remove software.
- workaround
- An alternative way to get something done when the normal way doesn't work.
- developers
- Developers are people who build software, apps, or websites.
- distribution
- All the work involved in getting your product or content in front of people — posting on social media, sending emails, sharing in communities, etc.
- config file
- A file that tells a tool how to behave.
- config
- Settings that tell a program how to work.
- workflow
- A repeatable set of steps for getting a task done.