Emacs: Difference between revisions

Warn about double-listing emacs-pgtk.
Arnecc (talk | contribs)
No edit summary
 
Line 104: Line 104:


</syntaxhighlight>Note that if the expression <code>(emacsPackagesFor emacs-pgtk)</code> is present, <code>emacs-pgtk</code> need not be listed separately in the list <code>environment.systemPackages</code>. Indeed, if one does that, <code>nixos-rebuild</code> will warn about link collisions when the configuration is rebuilt.
</syntaxhighlight>Note that if the expression <code>(emacsPackagesFor emacs-pgtk)</code> is present, <code>emacs-pgtk</code> need not be listed separately in the list <code>environment.systemPackages</code>. Indeed, if one does that, <code>nixos-rebuild</code> will warn about link collisions when the configuration is rebuilt.
====== Alternative way of installation to ensuring consistent package management for emacs and emacsclient ======
If you plan to use the same packages for both emacs and emacsclient, you can define a custom emacs like this:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
  nixpkgs.config.packageOverrides = pkgs: rec {
    myEmacs = pkgs.emacs.pkgs.withPackages (epkgs: with epkgs; [
      org
      nixmode
      ... # list all your desired emacsPackages here
    ]);
  };
</nowiki>}}
You may then reference it twice:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
  ## if you want it per-user instead of system-wide use 'users.users.<name>.packages = with pkgs; [' instead
  environment.systemPackages = with pkgs; [
    myEmacs
  ];
  ## enabling emacsclient and making all the packages available
  services.emacs = {
    enable = true;
    package = pkgs.myEmacs;
  };
</nowiki>}}
Using this approach, there is no need to keep two lists of emacsPackages in sync.


==== Tree-sitter ====
==== Tree-sitter ====