Skip to content
Nix expression for running Emacs Magit without installing it on your system
Nix Emacs Lisp
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Running Magit inside Nix-Shell

This is a Nix expression that runs Emacs with Magit, a Git porcelain inside Emacs. It is inspired by magit-docker (or Dockerized Magit) but uses Nix instead of Docker.


Since this program requires Nix, your operating system must support Nix. At present, Linux and Mac are supported, but Windows is not. However, you can install Nix on Windows Subsystem for Linux (WSL).


Install Nix package manager, if you haven’t already:

curl | sh

For details, see the Nix manual.


Inside a Git repository, run the following command:


Then Emacs starts and Magit displays the status of your Git repository.

It would be a good idea to define an alias for the command:

alias magit='nix-shell'


MIT License

You can’t perform that action at this time.