An intersection of Emacs and Nix.
Twist is a package manager for Emacs, written in Nix.
Its goal is to make Emacs configurations truly reproducible and reliable.
Features
Twist is different from other package managers for Emacs in the following aspects:
-
Reproducible builds with Nix
Rather than running a build process inside a running session of Emacs, Twist builds packages in a sandboxed Nix session. This ensures that your entire configuration is always reproducible.
-
Consistent lock system
All packages are tracked in a lock directory. You can keep a known good state of working configuration to a version control system, so you can restore the state whenever an upgrade breaks your configuration.
Your lock directory is like a Software Bill of Materials (SBOM), which helps to increase the security of your system.
-
Developer friendliness
Twist lets you control sources of individual packages easily. You can update individual packages using nix commands (e.g.
nix flake lock
) rather than upgrade all packages at once. This is especially useful if you are a constant contributor to Emacs Lisp packages. There is even an experimental Emacs user interface for updating flake inputs, nix3.el. -
Native-like user experience
Twist also supports hot-reloading of packages (experimental, through use of a standard wrapper and twist.el package). You can use new packages without restarting Emacs, while the configuration is still reproducible.
-
Complete runtime environment
Some Emacs Lisp packages have runtime dependencies on external programs. Twist can provide executable programs to Emacs by defining dependencies alongside the Emacs Lisp package declarations. The extra executables can be added without exiting Emacs, and they are only visible to Emacs.
Because Nixpkgs supports multiple platforms (Linux and macOS), your Emacs configuration will be a portable, self-contained environment for work.
-
Decentralized
Twist doesn't depend on a central server for building packages. It fetches sources from upstream repositories and builds them on your machine. It relies on the Nix ecosystem's infrastructure, which is backed by many commercial sponsors. You also have an option to set up a binary cache for your packages on a service like Cachix, and it is easy.
It supports the following types of packages:
- Packages from GNU ELPA and NonGNU ELPA
- Packages from MELPA
- Packages from Emacsmirror, including those archived in Emacsattic
- Custom packages defined in the form of MELPA-style recipes
nix3.el, the companion to Twist
nix3.el is an Emacs frontend to Nix flakes. Not only does it let you maintain the revisions of individual packages in your Emacs configuration, but it is also useful for working on other projects in any language, managed with Nix.
It is an interactive browsing interface to Nix flakes. You can update dependencies, build packages, run commands, and more. It grows as the system of Nix flakes evolves.
Discover more information
Explore more on Twist
- See example configurations
- Browse GitHub repositories
Getting started with Nix
- Download Nix
- Learn Nix on nix.dev
Support
File a ticket or join a discussion on GitHub
Donate
Coming soon