akirak / elinter

Nix-based CI and local testing framework for Emacs Lisp projects
GNU General Public License v3.0
18 stars 2 forks source link

Installation method #17

Open akirak opened 4 years ago

akirak commented 4 years ago

The current documentation suggests installing melpa-check CLI using nix-env, while asking the user to install the Emacs frontend as an Emacs package. This requires at least two steps for installing a single program, and there can be a version inconsistency between the two.

Since the user needs Nix anyway, it would be better to install both the executable and the Emacs package using Nix. I am not sure if this is feasible, especially for non-NixOS users, but it will be a better path, and it also removes the need for registration to MELPA.

Alternatively, it may be possible to prevent global installation of the executable. The executable is supposed to be run only inside existing projects, so with direnv, the user doesn't have to install it globally.

The current Emacs package requires dhall and yq, but they can be part of the Nix part. The user shouldn't have to install those programs only to publish an Emacs package.

There is a Nix RFC for flakes which looks related to this issue in the future.

tazjin commented 4 years ago

Please note that Nix flakes are just an experiment (in fact the current RFC has been withdrawn) and probably shouldn't be your sole/primary distribution method for the Nix code. It would be useful to be able to import the default.nix directly and pass in appropriate overrides to control the dependencies that are currently pinned (in general, in my view, dependency injection with default values should be used).

For CI use-cases you might want to build and distribute a container image using Nix. There's a dockerTools.buildLayeredImage function which makes this easy (and actually produces an image that is not tied to Docker specifically and will work in other engines).

akirak commented 4 years ago

Thanks. I was unable to understand how Nix flakes would work, so I'm not going to adopt it soon. Nonetheless, there were a couple of blog posts on flakes by Tweag.io, so it looked as if it were going to become a standard.

This project is still alpha, and I want to check if it can cover all cases before tidying up things. Updating emacs-overlay is a must for practical use, and providing a Docker image would be one solution, but I don't want to depend on Docker. I'm more inclined to setting an internal NIX_PATH containing emacs-overlay, but I'm not sure if it works in all situations.