You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a long time trying to figure out how to make an emacsWithPackages that contained my personal configuration. I wanted to avoid having an ~/.emacs.d/init.el`. I don't know where else to put this sort of knowledge, and it may not be idiomatic emacs, but I think it is worth documenting:
{pkgs?import<nixpkgs>{}}:
letstdenv=pkgs.stdenv;emacsEcosystem=pkgs.emacsPackagesNg;trivialBuild=pkgs.callPackage<nixpkgs/pkgs/build-support/emacs/trivial.nix>{emacs=pkgs.emacs;};my-mode=emacsEcosystem.trivialBuild{pname="my-mode";version="1970-01-01";src=pkgs.writeText"default.el"'' ;; You can put global config here, especially things that don't ;; symbols from plugins to be defined (global-set-key (kbd "<end>") 'end-of-line) (global-set-key (kbd "<home>") 'beginning-of-line) (add-hook 'before-save-hook 'delete-trailing-whitespace) (setq graphviz-dot-dot-program "${pkgs.graphviz}/bin/dot") (setq graphviz-dot-view-edit-command nil) (defun my-moode-delayed-load () (editorconfig-mode 1) ) (add-hook 'after-init-hook #'my-mode-delayed-load) '';};in(emacsEcosystem.emacsWithPackages(epkgs: withepkgs.melpaPackages;[editorconfiggraphviz-dot-mode]++[my-mode]))
The text was updated successfully, but these errors were encountered:
This gives some basics on configuring Emacs within Nix. The
configuration is fairly long just to give a good idea of what’s going
on. I can trim out some of it if it’s not necessary. Note that there
is already a section for Emacs in the NixOS manual. However, this is
aimed at avoiding using modules altogether to make things easier for
non-NixOS users. This configuration should work on NixOS anyway,
however.
FixesNixOS#24243FixesNixOS#19956
Issue description
I spent a long time trying to figure out how to make an
emacsWithPackages
that contained my personal configuration. I wanted to avoid having an ~/.emacs.d/init.el`. I don't know where else to put this sort of knowledge, and it may not be idiomatic emacs, but I think it is worth documenting:The text was updated successfully, but these errors were encountered: