Skip to content

emacs-twist/nix3.el

Repository files navigation

nix3.el: Nix maintains a graph of your projects

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.

Screenshots

https://github.com/emacs-twist/nix3.el/blob/screenshots/nix3-flake-show.png?raw=true

(Figure) nix3-flake-show displays the outputs and inputs of a flake.

https://github.com/emacs-twist/nix3.el/blob/screenshots/nix3-flake-show-url.png?raw=true

(Figure) nix3-flake-show-url displays a remote flake without cloning the repository.

Installation

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"))

Configuration

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.

Usage

  • 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 for nix flake show and nix flake metadata command.
  • nix3-flake-show-url command displays information on a remote flake. This is a remote variant of nix3-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 for nix flake init command.
  • nix3-flake-new command creates a new repository from a template. This is a wrapper for nix flake new command.

About

(WIP) Emacs interface to experimental commands of Nix

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published