Emacs: Difference between revisions
Added a workaround for a bug that hasn't been fixed upstream yet, when using xwidgets and pgtk. |
m fix formatting |
||
| Line 20: | Line 20: | ||
To temporarily use Emacs in a shell environment without modifying your system configuration, you can run: | To temporarily use Emacs in a shell environment without modifying your system configuration, you can run: | ||
<syntaxhighlight lang=console> | |||
< | |||
$ nix-shell -p emacs | $ nix-shell -p emacs | ||
</ | </syntaxhighlight> | ||
This makes the Emacs editor available in your current shell. You can then launch Emacs by typing <code>emacs</code>. | This makes the Emacs editor available in your current shell. You can then launch Emacs by typing <code>emacs</code>. | ||
| Line 149: | Line 148: | ||
You may then reference it twice: | You may then reference it twice: | ||
{{file|/etc/nixos/configuration.nix|nix| | {{file|/etc/nixos/configuration.nix|nix|3= | ||
## if you want it per-user instead of system-wide use 'users.users.<name>.packages = with pkgs; [' instead | ## if you want it per-user instead of system-wide use 'users.users.<name>.packages = with pkgs; [' instead | ||
environment.systemPackages = with pkgs; [ | environment.systemPackages = with pkgs; [ | ||
| Line 160: | Line 159: | ||
package = pkgs.myEmacs; | package = pkgs.myEmacs; | ||
}; | }; | ||
}} | |||
Using this approach, there is no need to keep two lists of emacsPackages in sync. | Using this approach, there is no need to keep two lists of emacsPackages in sync. | ||
| Line 309: | Line 308: | ||
They are located at <code>pkgs/applications/editors/emacs/elisp-packages/manual-packages/</code> [https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/emacs/elisp-packages/manual-packages] and a new pkg must be added under <code>pkgs/applications/editors/elisp-packages/manual-packages.nix</code> [https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix]. Once the nixpkg is ready, it can be tested using the following command. This inserts the nixpkg into the load-path of Emacs. | They are located at <code>pkgs/applications/editors/emacs/elisp-packages/manual-packages/</code> [https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/emacs/elisp-packages/manual-packages] and a new pkg must be added under <code>pkgs/applications/editors/elisp-packages/manual-packages.nix</code> [https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix]. Once the nixpkg is ready, it can be tested using the following command. This inserts the nixpkg into the load-path of Emacs. | ||
<syntaxhighlight lang=console> | |||
< | |||
$ nix-shell -I nixpkgs=<path_to_nixpkgs_copy> -p "(emacsPackagesFor pkgs.emacs28).emacsWithPackages (epkgs: [ epkgs.<package> ])" | $ nix-shell -I nixpkgs=<path_to_nixpkgs_copy> -p "(emacsPackagesFor pkgs.emacs28).emacsWithPackages (epkgs: [ epkgs.<package> ])" | ||
</ | </syntaxhighlight> | ||
}} | }} | ||