emacs: remove outdated doc about package initialization

Since Emacs 27[1], there is no need to call package-initialize in the
init file.

[1]: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS.27?id=cae528457cb862dc886a34240c9d4c73035b6659#n227

Lin Jian 665651c7 71a87531

Changed files
+2 -27
doc
builders
packages
nixos
modules
services
editors
pkgs
top-level
-4
doc/builders/packages/emacs.section.md
···
{
packageOverrides = pkgs: with pkgs; rec {
myEmacsConfig = writeText "default.el" ''
-
;; initialize package
-
-
(require 'package)
-
(package-initialize 'noactivate)
(eval-when-compile
(require 'use-package))
+2 -16
nixos/modules/services/editors/emacs.md
···
## Configuring Emacs {#module-services-emacs-configuring}
-
The Emacs init file should be changed to load the extension packages at
-
startup:
-
-
::: {.example #module-services-emacs-package-initialisation}
-
### Package initialization in `.emacs`
-
-
```
-
(require 'package)
-
-
;; optional. makes unpure packages archives unavailable
-
(setq package-archives nil)
-
-
(setq package-enable-at-startup nil)
-
(package-initialize)
-
```
-
:::
+
If you want to only use extension packages from Nixpkgs, you can add
+
`(setq package-archives nil)` to your init file.
After the declarative Emacs package configuration has been tested,
previously downloaded packages can be cleaned up by removing
-7
pkgs/top-level/emacs-packages.nix
···
# Alternative: use `emacs`, install everything to a system or user profile
# and then add this at the start your `init.el`:
/*
-
(require 'package)
-
-
;; optional. makes unpure packages archives unavailable
-
(setq package-archives nil)
-
;; optional. use this if you install emacs packages to the system profile
(add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
;; optional. use this if you install emacs packages to user profiles (with nix-env)
(add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
-
-
(package-initialize)
*/
{ pkgs'