From f5f1be35fd909e4a6422653b4612fca12251589a Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Sat, 14 Mar 2026 19:23:47 +0000 Subject: [PATCH] Adding import ./emacs.nix --- Droidnix/README.org | 150 ++++++++++-------- .../applications/terminal_shell/emacs.nix | 150 ++++++++++-------- 2 files changed, 170 insertions(+), 130 deletions(-) diff --git a/Droidnix/README.org b/Droidnix/README.org index 85ea9c340..6ea981e8c 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -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 diff --git a/Droidnix/generated/system/applications/terminal_shell/emacs.nix b/Droidnix/generated/system/applications/terminal_shell/emacs.nix index 66513a06e..fb4209d02 100644 --- a/Droidnix/generated/system/applications/terminal_shell/emacs.nix +++ b/Droidnix/generated/system/applications/terminal_shell/emacs.nix @@ -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; }