Emacs: Difference between revisions

From NixOS Wiki
imported>Appetrosyan
Added description.
imported>Appetrosyan
Added use of the file template.
Line 8: Line 8:
=== Emacs overlay ===
=== Emacs overlay ===
As of July 2021, the Nix community offers [https://github.com/nix-community/emacs-overlay/blob/f177e5d14ad2e1edceb63f3ab8aa9748ebe6383c/default.nix#L104 7 variants of GNU Emacs] as overlays: emacsGit, emacsGcc, emacsPgtk, emacsPgtkGcc, emacsUnstable, emacsGit-nox, and emacsUnstable-nox. For installing one of them, add the following lines to {{ic|/etc/nixos/configuration.nix}} (replace emacsPgtkGcc with the variant of your choice).
As of July 2021, the Nix community offers [https://github.com/nix-community/emacs-overlay/blob/f177e5d14ad2e1edceb63f3ab8aa9748ebe6383c/default.nix#L104 7 variants of GNU Emacs] as overlays: emacsGit, emacsGcc, emacsPgtk, emacsPgtkGcc, emacsUnstable, emacsGit-nox, and emacsUnstable-nox. For installing one of them, add the following lines to {{ic|/etc/nixos/configuration.nix}} (replace emacsPgtkGcc with the variant of your choice).
<syntaxhighlight lang="nix">
{{file|configuration.nix|nix|<nowiki>
{
{
   services.emacs.package = pkgs.emacsPgtkGcc;
   services.emacs.package = pkgs.emacsPgtkGcc;
Line 24: Line 24:
   ];
   ];
}
}
</syntaxhighlight>
</nowiki>}}


[[Category:NixOS]]
[[Category:NixOS]]
[[Category:Incomplete]]
[[Category:Incomplete]]

Revision as of 12:48, 17 July 2021

For reference use the emacs chapter in the nixos manual.

About

Emacs is an interactive graphical emacs lisp interpreter that comes with many applications, but is primarily used as a text and code editor. It has one of the largest repositories of packages of any similar code editor such as vim or its fork neovim.

Installation

Emacs overlay

As of July 2021, the Nix community offers 7 variants of GNU Emacs as overlays: emacsGit, emacsGcc, emacsPgtk, emacsPgtkGcc, emacsUnstable, emacsGit-nox, and emacsUnstable-nox. For installing one of them, add the following lines to /etc/nixos/configuration.nix (replace emacsPgtkGcc with the variant of your choice).

configuration.nix
{
  services.emacs.package = pkgs.emacsPgtkGcc;

  nixpkgs.overlays = [
    (import (builtins.fetchGit {
      url = "https://github.com/nix-community/emacs-overlay.git";
      ref = "master";
      rev = "bfc8f6edcb7bcf3cf24e4a7199b3f6fed96aaecf"; # change the revision
    }))
  ];

  environment.systemPackages = with pkgs; [
    emacsPgtkGcc
  ];
}