This repository has been archived on 2024-07-03. You can view files and clone it, but cannot push or open issues or pull requests.
home-manager/programs/emacs/default.nix
Evie Litherland-Smith 872c0b099c Split prog into python and lua
Make python/default.nix and lua/default.nix to replace
prog/default.nix for each respective language's packages

Move dev tools from prog into emacs/default.nix since that's what
they're relevant for.

Add some extra useful python packages (numpy, scipy, xarray,
matplotlib)

Add yamllint for YAML, associated flymake-yamllint for Emacs, remove
flymake-eslint since I'm not using it

Add lua-language-server and bash-language-server
2024-05-13 11:58:11 +01:00

190 lines
4.1 KiB
Nix

{
config,
pkgs,
fonts,
...
}: {
programs.emacs = {
# Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git
# git clone https://git.xenia.me.uk/pixelifytica/emacs.git ~/.config/emacs
enable = true;
package = pkgs.emacs29-pgtk;
extraConfig = let
shell = "${pkgs.zsh}/bin/zsh";
font = "${fonts.monospace.name}-${toString fonts.sizes.applications}";
fixed-font-family = "${fonts.monospace.name}";
variable-font-family = "${fonts.sansSerif.name}";
alpha = "80";
in ''
(customize-set-variable 'shell-file-name "${shell}")
(add-to-list 'initial-frame-alist '(font . "${font}"))
(add-to-list 'default-frame-alist '(font . "${font}"))
(set-face-attribute 'fixed-pitch nil :family "${fixed-font-family}")
(set-face-attribute 'fixed-pitch-serif nil :family "${fixed-font-family}")
(set-face-attribute 'variable-pitch nil :family "${variable-font-family}")
(add-to-list 'initial-frame-alist '(alpha-background . ${alpha}))
(add-to-list 'default-frame-alist '(alpha-background . ${alpha}))
(scroll-bar-mode -1)
(tab-bar-mode -1)
(menu-bar-mode -1)
'';
extraPackages = epkgs:
with epkgs; [
# Theme
base16-theme
# UI
all-the-icons
nerd-icons
nerd-icons-completion
nerd-icons-corfu
nerd-icons-dired
nerd-icons-ibuffer
doom-modeline
diminish
ligature
page-break-lines
helpful
which-key
link-hint
diff-hl
# Completion
cape
consult
consult-eglot
consult-flyspell
corfu
corfu-terminal
embark
embark-consult
marginalia
orderless
vertico
# Snippets
tempel
tempel-collection
# spell-checking
flyspell-correct
# password-store
pass
password-store
# IDE
treesit-grammars.with-all-grammars
treesit-auto
flymake-popon
flymake-collection
flymake-shellcheck
flymake-yamllint
apheleia
direnv
rainbow-delimiters
aggressive-indent
nix-mode
python-docstring
# Media
emms
# org-mode
org-roam
org-noter
org-journal
# org-cite
citar
citar-embark
# org-plot
gnuplot
# org-mode HTML export
htmlize
# Projects
ibuffer-project
magit
forge
# Writing
markdown-mode
pandoc-mode
auctex
auctex-latexmk
latex-preview-pane
# Email
mu4e
# RSS feeds
elfeed
elfeed-org
elfeed-tube
];
};
services = {
emacs = {
enable = true;
package = config.programs.emacs.finalPackage;
defaultEditor = true;
client.enable = true;
socketActivation.enable = true;
startWithUserSession = false;
};
git-sync.repositories = with config.xdg.userDirs; {
org = {
path = "${documents}/Org";
uri = "git+https://git.xenia.me.uk/xenia/org.git";
};
references = {
path = "${documents}/References";
uri = "git+https://git.xenia.me.uk/xenia/references.git";
};
};
};
home.packages = with pkgs; [
# Emacs requirements
imagemagick
languagetool
wordnet
gnuplot # For org-plot
graphviz # For org-roam graph
mp3info # For EMMS
# Language-specific requirements
sqlite
pandoc
ghostscript
poppler_utils
# Customised LaTeX install
(texlive.combine {
inherit (pkgs.texlive) scheme-medium dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of;
})
# Development tools
# Python is a special case, installed separately
## Language servers
nil
fortls
lua-language-server
nodePackages.bash-language-server
## Linters
shellcheck
yamllint
## Formatters
alejandra
shfmt
black
isort
stylua
nodePackages.prettier
];
}