emacs: move from hermes to its own module

This commit is contained in:
Payas Relekar 2023-09-28 17:44:04 +05:30
parent 80547f6838
commit 03f4c32fc0
10 changed files with 1760 additions and 1 deletions

View file

@ -4,9 +4,9 @@
imports = [
../../modules/common-home.nix
../../modules/neovim/nvim.nix
../../modules/emacs/emacs.nix
./mail.nix
./emacs.nix
];
home.packages = with pkgs; [

2
modules/emacs/doom/.gitignore vendored Executable file
View file

@ -0,0 +1,2 @@
config.el
packages.el

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

225
modules/emacs/doom/init.el Executable file
View file

@ -0,0 +1,225 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a "Module Index" link where you'll find
;; a comprehensive list of Doom's modules and what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;(ivy ; a search engine for love and life
;; +fuzzy
;; +icons)
(vertico
+icons)
:ui
;; deft ; notational velocity for Emacs
;; doom ; what makes DOOM look the way it does
;;doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;fill-column ; a `fill-column' indicator
;; hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;; indent-guides ; highlighted indent columns
;; ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;+all ; catch all popups that start with asterisk
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;; unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
;;tilde-vi-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows
;;workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
;; (evil +everywhere) ; come to the dark side, we have cookies
;;file-templates ; auto-snippets for empty files
;;fold ; (nigh) universal code folding
(format) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;; lispy ; vim for lisp, for people who don't like vim
multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;(parinfer
;; +rust) ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
(dired ; making dired pretty [functional]
+dirvish)
electric ; smarter, keyword-based electric-indent
(ibuffer) ; interactive buffer management
(undo ; persistent, smarter undo for your inevitable mistakes
+tree)
vc ; version-control and Emacs, sitting in a tree
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
;; (syntax) ; tasing you for every semicolon you forget
;; (spell ; tasing you for misspelling mispelling
;; +enchant)
;;grammar ; tasing grammar mistake every you make
:tools
;;ansible
biblio
;; (debugger ; FIXME stepping through code, to help you add bugs
;; +lsp)
direnv
;; (docker
;; +lsp)
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;; gist ; interacting with github gists
;; lookup ; navigate your code and its documentation
(lsp
+eglot)
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;; pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree...
upload ; map local to remote projects via ssh/ftp
:os
;;(:if IS-MAC macos); improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;; (beancount ; mind the GAAP
;; +lsp
;; +tree-sitter)
;;cc ; C/C++/Obj-C madness
;; clojure ; java with a lisp
;; common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;; (elixir ; erlang done right
;; +lsp
;; +tree-sitter)
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;faust ; dsp, but you get to keep your soul
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;; (gdscript +lsp) ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(haskell +dante) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris
;; json ; At least it ain't XML
(java ; the poster child for carpal tunnel syndrome
+lsp
+tree-sitter)
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
(latex ; writing papers in Emacs has never been so fun
+lsp)
;;lean
;;factor
;; ledger ; an accounting system in Emacs
lua ; one-based indices? one-based indices
;;markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
(nix ; I hereby declare "nix geht mehr!"
+lsp
+tree-sitter)
;;ocaml ; an objective camel
(org ; organize your plain life in plain text
+babel ; run inline code from org files
+capture ; org-capture in and outside of emacs
+roam2 ; bidirectional linking like roam-research
+noter
+hugo
+pandoc)
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
;; (python ; beautiful is better than ugly
;; +lsp
;; +pyenv
;; +poetry)
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
(rest ; Emacs as a REST client
+jq)
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
(rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
+tree-sitter
+lsp)
;;scala ; java, but good
;;scheme ; a fully conniving family of lisps
(sh ; she sells {ba,z,fi}sh shells on the C xor
+fish
+tree-sitter)
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
(web ; the tubes
+lsp
+tree-sitter)
;;yaml ; JSON, but readable
:email
(mu4e +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
calendar
;;irc ; how neckbeards socialize
;; (rss ; emacs as an RSS reader
;; +org)
;;twitter ; twitter client https://twitter.com/vnought
:config
literate
(default +bindings +smartparens))

View file

@ -0,0 +1,163 @@
personal_ws-1.1 en 160
Aai
Arkham
Awk
Baba
Bancontact
Bibtex
Bikeshedding
CLI
Config
Darshana
Dired
Dirvish
EWW
Eglot
Elfeed
Ement
Esc
Exercism
Fira
FiraCode
Gerrit
Gmail
Grissom
IDEs
IETF
IMAP
Iosevka
Javascript
JetBrains
KDE
Kanban
Konsole
Laken
LocalWords
Magit
Modus
Navidrome
Nikhil
NixOS
Noto
PDFTools
PRs
Payas
Phule
Postgres
Protesilaos
Pune
QoL
RDP
README
REPL
RET
RSS
Relekar
Richa
Ripgrep
Roboto
Rocinante
SPC
SSD
Saiprasad
Savitribai
Stavrou
Syncthing
Systemd
TODO
UUID
UX
Urwashi
VLC
VM
WMs
WSL
YAML
architected
bhankas
bikeshedding
bootloader
broot
bytecode
config
configs
customizable
customizations
de
declaratively
dev
dicking
dired
dirs
distro
dogfooding
dotfiles
drvfs
el
elfeed
elisp
emacs
env
esque
filesystem
filesystems
fmt
gitignore
gitlab
glyphs
gmail
hashtable
hl
homedir
html
htop
init
intellij
introspectable
ish
keybind
linter
lockfiles
luminance
magit
maildir
mbsync
modeline
modus
monospace
msmtp
namespace
navidrome
nixfmt
nixpkgs
operandi
pandoc
performant
profiler
qBittorrent
reflow
relekar
repo
restic
rewatch
rewatches
rg
ripgrep
scalable
shitshow
sqlite
sr
standardisation
toml
transclusion
transcoding
typit
unix
untethered
upstreamed
vivendi
vterm
whitespace
yasnippet
nVidia
Micronaut

View file

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: dictup
# key: dup
# uuid: dup
# condition: t
# --
dict: update

View file

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: flake.lock
# key: flo
# uuid: flo
# condition: t
# --
flake.lock: `(insert (format-time-string "%Y_%m_%d"))`
`(clipboard-yank)`

View file

@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: naukri reply
# uuid: nauk
# key: nauk
# condition: t
# --
Hello ${1:name},
Thank you for reaching out. Please find below details as requested.
`(progn
(save-excursion
(end-of-buffer)
(mail-add-attachment "~/git/resume/resume.pdf"))
(clipboard-yank))`
Please find my updated resume attached.
Let me know for any questions.
Thank you,
Payas Relekar

119
modules/emacs/emacs.nix Normal file
View file

@ -0,0 +1,119 @@
{ pkgs, lib, ... }:
let
doombin = "/home/payas/.config/emacs/bin/doom";
doomsync = ''
if [ -x "${doombin}" ]; then
timeout 100s ${doombin} sync;
fi
'';
in
{
home = {
file = {
# Doomemacs config
doom = {
enable = true;
executable = false;
recursive = true;
source = ./doom;
target = "/home/payas/.doom.d";
onChange = doomsync;
};
# Enchant ordering: Use aspell for all dicts
enchant = {
enable = true;
executable = false;
recursive = false;
text = "*:aspell";
target = "/home/payas/.config/enchant/enchant.ordering";
};
};
activation.doom = lib.hm.dag.entryAfter [ "writeBoundary" ] doomsync;
};
programs = {
# Emacs unstable (currently 29.0.91) with extra packages (that require native component)
emacs = {
enable = true;
package = pkgs.emacs29-pgtk;
extraPackages = epkgs: with epkgs; [
mu4e
jinx
pdf-tools
saveplace-pdf-view
org-pdftools
org-noter
emacsql
emacsql-sqlite
emacsql-sqlite-builtin
vterm
all-the-icons
treesit-grammars.with-all-grammars
];
};
};
home.packages = with pkgs; [
binutils # native-comp needs 'as', provided by this
sqlite # for org-roam
gcc # also for org-roam
# aspell is used by ispell for spell check
(aspellWithDicts (dicts: with dicts; [
en
en-computers
en-science
mr
hi
]))
# used by jinx package for spell checking
enchant
imagemagick
tectonic # munging TeX better than texlive
texlive.combined.scheme-full # because org-babel cannot use tectonic
# lua53Packages.digestif # luajit version is broken
pandoc # convert doc formats
# ghostscript # munging pfds
pdftk # munging pdfs in less incantation-y way
# Nix things
nixpkgs-fmt
nil
nixd
# Java language server
jdt-language-server
jetbrains.idea-community
# graalvm17-ce
maven
# Rust
rustc
cargo
rustfmt
rust-analyzer
pkg-config
# Golang
go
gopls
# SQLite
sqlite
# Exercism
exercism
godot3
hledger
# Lua
luajit
lua-language-server
];
}