nix3.el
is an experimental Emacs interface to experimental commands of Nix.
Its goal is to enable the user to easily work across multiple projects.
A typical use case is a complex application/program that consists of multiple repositories:
- The main application is a Nix flake.
- Its dependencies are maintained in separate repositories. They may be or may not be flakes.
In a project like this, you typically clone the source of a dependency, fix a bug or add a feature, and rebuild the main application.
The goal of nix3.el
is to accelerate this cycle by supporting both local and remote flakes.
(Figure) nix3-flake-show
displays the outputs and inputs of a flake.
(Figure) nix3-flake-show-url
displays a remote flake without cloning the repository.
nix3.el
is not available from any of the popular Emacs Lisp package registries (GNU/nonGNU ELPA, MELPA, etc.) yet.
Clone this repository and add the directory to the load-path.
extra directory contains extra packages that depend on nix3.el
.
You can use the following MELPA-style recipes:
(magit-nix3 :fetcher github :repo "emacs-twist/nix3.el"
:files ("extra/magit-nix3.el"))
nix3.el
doesn’t require specific configuration, but nix3
customization group provides several options.
magit-nix3-flake-mode
adds flake input and output sections to magit-status-mode
.
You can use the following configuration:
(use-package magit-nix3
:after magit-status
:config
(magit-nix3-flake-mode t))
See magit-nix3
customization group for more options.
nix3-transient
dispatches a transient interface for the current flake.nix3-flake-show
command displays information on a flake on filesystem. This is a wrapper fornix flake show
andnix flake metadata
command.nix3-flake-show-url
command displays information on a remote flake. This is a remote variant ofnix3-flake-show
.nix3-flake-init
command lets you pick a template from the registry and copy the files into the current repository. This is a wrapper fornix flake init
command.nix3-flake-new
command creates a new repository from a template. This is a wrapper fornix flake new
command.