Emacs: Difference between revisions

Pigs (talk | contribs)
m Advanced: defaultEditor is only an option for services.emacs, not programs.emacs
Pigs (talk | contribs)
m System setup: make it clear the distinction between installing system wide vs home manager
Line 30: Line 30:


To install Emacs system-wide, making it available to all users, add the following to your configuration:
To install Emacs system-wide, making it available to all users, add the following to your configuration:
<syntaxhighlight lang="nix">
 
# Example for /etc/nixos/configuration.nix
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
environment.systemPackages = [
environment.systemPackages = [
   pkgs.emacs
   pkgs.emacs
];
];
</nowiki>
}}


# User-specific installation (in ~/.config/nixpkgs/home.nix)
Alternatively, Emacs can be installed specific to a user via [[Home Manager]]:
 
{{file|home.nix|nix|<nowiki>
home.packages = [
home.packages = [
   pkgs.emacs
   pkgs.emacs
];
];
</syntaxhighlight>
</nowiki>
}}
 
After rebuilding your system with <code>nixos-rebuild switch</code> or <code>home-manager switch</code>, Emacs will be installed and accessible.
After rebuilding your system with <code>nixos-rebuild switch</code> or <code>home-manager switch</code>, Emacs will be installed and accessible.