This commit is contained in:
2025-09-13 23:16:22 +02:00
commit 5057e1effa
179 changed files with 20524 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
{ pkgs, ... }:
let
doom-icon = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/jeetelongname/doom-banners/master/splashes/doom/doom-emacs-color2.svg";
sha256 = "1xxi5ra1z8njsqaqiaq96wyn1sc967l42kvjzbji1zrjj8za6bgq";
};
in
{
# 1. Create a script to install Doom Emacs
home.packages = [
(pkgs.writeShellScriptBin "get-doom" ''
#!/usr/bin/env bash
set -e
# --- Icons ---
ICON_CHECK=""
ICON_INFO=""
ICON_ROCKET="🚀"
# --- Helper Functions ---
print_status() {
echo
echo "--- $ICON_INFO $1 ---"
}
print_success() {
echo "--- $ICON_CHECK $1 ---"
}
print_banner() {
echo "==============================="
echo " Doom Emacs Installer $ICON_ROCKET"
echo "==============================="
}
# --- Main Script ---
print_banner
EMACSDIR="$HOME/.emacs.d"
if [ -d "$EMACSDIR" ]; then
print_success "Doom Emacs is already installed."
exit 0
fi
print_status "Cloning Doom Emacs..."
git clone --depth 1 https://github.com/doomemacs/doomemacs "$EMACSDIR"
print_success "Doom Emacs cloned."
print_status "Running Doom install..."
"$EMACSDIR/bin/doom" install
print_success "Doom install complete."
print_status "Running doom sync..."
"$EMACSDIR/bin/doom" sync
print_success "Doom sync complete."
echo
print_success "All done! Doom Emacs is ready to use."
'')
];
# 2. Add the bin directory to the PATH
home.sessionPath = [
"$HOME/.emacs.d/bin"
];
# 3. Create a desktop file
xdg.desktopEntries.doom-emacs = {
name = "Doom Emacs";
comment = "A configuration framework for GNU Emacs";
exec = "emacs";
icon = doom-icon;
terminal = false;
type = "Application";
categories = [ "Development" "TextEditor" ];
};
}

View File

@@ -0,0 +1,162 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
emacs-gtk
git
lazygit
ripgrep
libtool
cmake
pkg-config
# Spell checking
hunspell
hunspellDicts.en_US
hunspellDicts.en_AU
hunspellDicts.es_ES
# LSP servers
clang-tools # C/C++ LSP
nil # Nix LSP
];
home.file.".doom.d/init.el".text = ''
;;; init.el -*- lexical-binding: t; -*-
(doom!
:completion
(company +auto)
(vertico +icons)
:ui
doom
doom-dashboard
doom-quit
hl-todo
modeline
nav-flash
ophints
(popup +defaults)
(ligatures +extra)
tabs
treemacs
vi-tilde-fringe
window-select
:editor
(evil +everywhere)
file-templates
fold
multiple-cursors
snippets
word-wrap
:emacs
(dired +icons)
electric
(ibuffer +icons)
(undo +tree)
vc
:term
vterm
:checkers
(syntax +flymake)
(spell +flyspell)
grammar
:tools
(eval +overlay)
(lookup +docsets)
lsp
(magit +forge)
pdf
tree-sitter
:lang
bash
(c +lsp)
css
docker
html
(json +lsp)
markdown
(nix +tree-sitter +lsp)
toml
yaml
:config
(default +bindings +smartparens))
'';
home.file.".doom.d/config.el".text = ''
;;; config.el -*- lexical-binding: t; -*-
(setq doom-theme 'doom-one)
(setq display-line-numbers-type 'relative)
(setq nerd-icons-font-family "JetBrainsMono Nerd Font")
;; Git configuration
(after! magit
;; Set default git editor to emacsclient
(setq with-editor-emacsclient-executable "emacsclient")
;; Show word-granularity differences within diff hunks
(setq magit-diff-refine-hunk t)
;; Auto-refresh magit buffers
(setq magit-refresh-status-buffer t))
;; Lazygit integration
(defun my/lazygit ()
"Open lazygit in a terminal."
(interactive)
(if (fboundp 'vterm)
(let ((default-directory (magit-toplevel)))
(vterm "*lazygit*")
(vterm-send-string "lazygit")
(vterm-send-return))
(async-shell-command "lazygit" "*lazygit*")))
;; LSP configuration
(after! lsp-mode
(setq lsp-signature-auto-activate t
lsp-signature-render-documentation t
lsp-completion-provider :company-capf
lsp-idle-delay 0.1))
;; Nix LSP (nil) configuration
(with-eval-after-load 'lsp-nix-nil
(setq lsp-nix-nil-auto-eval-inputs t))
;; Company completion settings
(after! company
(setq company-idle-delay 0.2
company-minimum-prefix-length 1
company-tooltip-align-annotations t
company-require-match 'never))
;; Spell checking configuration
(after! ispell
(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "en_US")
(setq ispell-local-dictionary-alist
'(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8))))
;; Git keybindings
(map! :leader
(:prefix-map ("g" . "git")
:desc "Magit status" "g" #'magit-status
:desc "Magit dispatch" "d" #'magit-dispatch
:desc "Magit file dispatch" "f" #'magit-file-dispatch
:desc "Magit blame" "b" #'magit-blame-addition
:desc "Git time machine" "t" #'git-timemachine-toggle
:desc "Lazygit" "l" #'my/lazygit
:desc "Git stage file" "s" #'magit-stage-file
:desc "Git unstage file" "u" #'magit-unstage-file))
'';
home.file.".doom.d/packages.el".text = ''
;;; packages.el -*- lexical-binding: t; -*-
;; Git-related packages
(package! git-timemachine)
'';
}