Adding import ./emacs.nix

This commit is contained in:
2026-03-14 19:23:47 +00:00
parent 7d3f12d918
commit f5f1be35fd
2 changed files with 170 additions and 130 deletions
+85 -65
View File
@@ -1770,72 +1770,92 @@ This sets up the zsh terminal
** =generated/system/applications/terminal_shell/emacs.nix=
This sets up the emacs terminal
#+BEGIN_SRC nix :tangle generated/system/applications/terminal_shell/emacs.nix :noweb tangle :mkdirp yes :eval never-html
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
programs.emacs = {
enable = true;
# install with tree sitter enabled
package = (pkgs.emacs-pgtk.override { withTreeSitter = true; });
extraPackages = epkgs: [
# also install all tree sitter grammars
epkgs.manualPackages.treesit-grammars.with-all-grammars
epkgs.nerd-icons # nerd fonts support
epkgs.doom-modeline # model line
epkgs.diminish # hides modes from modeline
epkgs.eldoc # doc support
epkgs.pulsar # pulses the cursor when jumping about
epkgs.which-key # help porcelain
epkgs.expreg # expand region
epkgs.vundo # undo tree
epkgs.puni # structured editing
epkgs.avy # jumping utility
epkgs.consult # emacs right click
epkgs.vertico # minibuffer completion
epkgs.marginalia # annotations for completions
epkgs.crux # utilities
epkgs.magit # git porcelain
epkgs.nerd-icons-corfu # nerd icons for completion
epkgs.corfu # completion
epkgs.cape # completion extensions
epkgs.orderless # search paradigm
epkgs.yasnippet # snippets support
epkgs.yasnippet-snippets # commonly used snippets
epkgs.rg # ripgrep
epkgs.exec-path-from-shell # load env and path
epkgs.eat # better shell
epkgs.rust-mode # rust mode (when rust-ts doesn't cut it)
epkgs.rustic # more rust things
epkgs.nix-mode # nix lang
epkgs.hcl-mode # hashicorp file mode
epkgs.shell-pop # quick shell popup
epkgs.envrc # support for loading .envrc
epkgs.nixpkgs-fmt # format nix files
epkgs.f # string + file utilities
epkgs.gptel # llm chat (mainly claude)
epkgs.catppuccin-theme # catppuccin theme
epkgs.eldoc-box # docs in a box
epkgs.sideline # mainly for flymake errors on the side
epkgs.sideline-flymake # mainly for flymake errors on the side
epkgs.sideline-eglot # mainly for flymake errors on the side
];
};
home.sessionVariables = {
EDITOR = "emacs";
XDG_SCREENSHOTS_DIR = "~/screenshots";
};
home.file = {
emacs-init = {
source = ./early-init.el;
target = ".emacs.d/early-init.el";
};
emacs = {
source = ./init.el;
target = ".emacs.d/init.el";
};
};
services.nextcloud-client = {
enable = true;
};
programs.emacs = {
enable = true;
package = pkgs.emacs-pgtk.override { withTreeSitter = true; };
# Group related packages for clarity and easier maintenance
extraPackages = epkgs: with epkgs; [
# Tree-sitter and language support
manualPackages.treesit-grammars.with-all-grammars
rust-mode
rustic
nix-mode
hcl-mode
# UI/UX and navigation
nerd-icons
doom-modeline
diminish
eldoc
eldoc-box
pulsar
which-key
avy
consult
vertico
marginalia
crux
shell-pop
# Completion and snippets
nerd-icons-corfu
corfu
cape
orderless
yasnippet
yasnippet-snippets
# Utilities and tools
rg
exec-path-from-shell
eat
f
gptel
nixpkgs-fmt
envrc
# Theming
catppuccin-theme
# Git
magit
# Editing and workflow
expreg
vundo
puni
# Error and side panel support
sideline
sideline-flymake
sideline-eglot
];
};
# Home Manager session variables
home.sessionVariables = {
EDITOR = "emacs";
XDG_SCREENSHOTS_DIR = "${pkgs.lib.getHome}/screenshots";
};
# Home Manager file management
home.file = {
"emacs/early-init.el" = {
source = ./early-init.el;
target = ".emacs.d/early-init.el";
};
"emacs/init.el" = {
source = ./init.el;
target = ".emacs.d/init.el";
};
};
# Services (if needed in Home Manager context)
services.nextcloud-client.enable = true;
}
#+END_SRC
@@ -1,67 +1,87 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
programs.emacs = {
enable = true;
# install with tree sitter enabled
package = (pkgs.emacs-pgtk.override { withTreeSitter = true; });
extraPackages = epkgs: [
# also install all tree sitter grammars
epkgs.manualPackages.treesit-grammars.with-all-grammars
epkgs.nerd-icons # nerd fonts support
epkgs.doom-modeline # model line
epkgs.diminish # hides modes from modeline
epkgs.eldoc # doc support
epkgs.pulsar # pulses the cursor when jumping about
epkgs.which-key # help porcelain
epkgs.expreg # expand region
epkgs.vundo # undo tree
epkgs.puni # structured editing
epkgs.avy # jumping utility
epkgs.consult # emacs right click
epkgs.vertico # minibuffer completion
epkgs.marginalia # annotations for completions
epkgs.crux # utilities
epkgs.magit # git porcelain
epkgs.nerd-icons-corfu # nerd icons for completion
epkgs.corfu # completion
epkgs.cape # completion extensions
epkgs.orderless # search paradigm
epkgs.yasnippet # snippets support
epkgs.yasnippet-snippets # commonly used snippets
epkgs.rg # ripgrep
epkgs.exec-path-from-shell # load env and path
epkgs.eat # better shell
epkgs.rust-mode # rust mode (when rust-ts doesn't cut it)
epkgs.rustic # more rust things
epkgs.nix-mode # nix lang
epkgs.hcl-mode # hashicorp file mode
epkgs.shell-pop # quick shell popup
epkgs.envrc # support for loading .envrc
epkgs.nixpkgs-fmt # format nix files
epkgs.f # string + file utilities
epkgs.gptel # llm chat (mainly claude)
epkgs.catppuccin-theme # catppuccin theme
epkgs.eldoc-box # docs in a box
epkgs.sideline # mainly for flymake errors on the side
epkgs.sideline-flymake # mainly for flymake errors on the side
epkgs.sideline-eglot # mainly for flymake errors on the side
];
};
home.sessionVariables = {
EDITOR = "emacs";
XDG_SCREENSHOTS_DIR = "~/screenshots";
};
home.file = {
emacs-init = {
source = ./early-init.el;
target = ".emacs.d/early-init.el";
};
emacs = {
source = ./init.el;
target = ".emacs.d/init.el";
};
};
services.nextcloud-client = {
enable = true;
};
programs.emacs = {
enable = true;
package = pkgs.emacs-pgtk.override { withTreeSitter = true; };
# Group related packages for clarity and easier maintenance
extraPackages = epkgs: with epkgs; [
# Tree-sitter and language support
manualPackages.treesit-grammars.with-all-grammars
rust-mode
rustic
nix-mode
hcl-mode
# UI/UX and navigation
nerd-icons
doom-modeline
diminish
eldoc
eldoc-box
pulsar
which-key
avy
consult
vertico
marginalia
crux
shell-pop
# Completion and snippets
nerd-icons-corfu
corfu
cape
orderless
yasnippet
yasnippet-snippets
# Utilities and tools
rg
exec-path-from-shell
eat
f
gptel
nixpkgs-fmt
envrc
# Theming
catppuccin-theme
# Git
magit
# Editing and workflow
expreg
vundo
puni
# Error and side panel support
sideline
sideline-flymake
sideline-eglot
];
};
# Home Manager session variables
home.sessionVariables = {
EDITOR = "emacs";
XDG_SCREENSHOTS_DIR = "${pkgs.lib.getHome}/screenshots";
};
# Home Manager file management
home.file = {
"emacs/early-init.el" = {
source = ./early-init.el;
target = ".emacs.d/early-init.el";
};
"emacs/init.el" = {
source = ./init.el;
target = ".emacs.d/init.el";
};
};
# Services (if needed in Home Manager context)
services.nextcloud-client.enable = true;
}