nixos/home/emacs/default.nix
Evie Litherland-Smith 395c93db09 Add emacs font and opacity config to expression
Set stylix opacity for applications and desktop to 0.8 as well

Use stylix font and opacity values for emacs rather than duplicating
2024-02-02 10:47:42 +00:00

183 lines
3.5 KiB
Nix

{
config,
pkgs,
...
}: {
programs.emacs = {
# Clone emacs config from https://git.xenia.me.uk/xenia/emacs.git
enable = true;
package = pkgs.emacs29-pgtk;
extraConfig = with builtins;
with config; let
font = "${stylix.fonts.monospace.name}-${toString stylix.fonts.sizes.applications}";
alpha = "${toString (floor (mul stylix.opacity.applications 100))}";
in ''
(org-babel-load-file "~/.emacs/README.org")
(add-to-list 'initial-frame-alist '(font . "${font}"))
(add-to-list 'default-frame-alist '(font . "${font}"))
(add-to-list 'initial-frame-alist '(alpha-background . ${alpha}))
(add-to-list 'default-frame-alist '(alpha-background . ${alpha}))
'';
extraPackages = epkgs:
with epkgs; [
# theme
modus-themes
# spell-checking
flyspell-correct
consult-flyspell
# password-store
password-store
password-store-otp
pass # password-store major mode
# completion-packages
cape
consult
consult-eglot
consult-yasnippet
corfu
corfu-terminal
embark
embark-consult
marginalia
orderless
vertico
# snippets-packages
yasnippet
yasnippet-snippets
yasnippet-capf
# ide-packages
treesit-grammars.with-all-grammars
treesit-auto
flymake-popon
flymake-shellcheck
apheleia
direnv
rainbow-delimiters
aggressive-indent
nix-mode
lua-mode
cargo
# media-packages
emms
# org-packages
org-roam
org-alert
org-noter
org-journal
citar
citar-embark
gnuplot
# project-packages
ibuffer-project
magit
forge
# ui-packages
all-the-icons
nerd-icons
nerd-icons-completion
nerd-icons-corfu
nerd-icons-dired
nerd-icons-ibuffer
diminish
ligature
page-break-lines
helpful
which-key
link-hint
diff-hl
# writing-packages
markdown-mode
pandoc-mode
auctex
auctex-latexmk
latex-preview-pane
# email-packages
mu4e
# feed-packages
elfeed
elfeed-org
elfeed-tube
elfeed-tube-mpv
];
};
services.emacs = {
enable = true;
package = config.programs.emacs.finalPackage;
startWithUserSession = false;
defaultEditor = true;
client.enable = true;
socketActivation.enable = true;
};
home.packages = with pkgs; [
# Emacs requirements
fd
ripgrep
imagemagick
languagetool
wordnet
(aspellWithDicts (ds: with ds; [en en-computers en-science]))
# For org-plot
gnuplot
# For EMMS
mp3info
# Language-specific requirements
sqlite
pandoc
ghostscript
mupdf
poppler_utils
# Customised LaTeX install
# texlive.combined.scheme-full
(texlive.combine {
inherit
(pkgs.texlive)
scheme-basic
dvisvgm
dvipng
wrapfig
amsmath
ulem
hyperref
capt-of
beamer
;
})
# Linters
shellcheck
# Formatters
nodePackages.prettier
alejandra
ruff
isort
fprettify
rustfmt
stylua
shfmt
# LSP Servers
nil
fortls
rust-analyzer
luajitPackages.lua-lsp
python3Packages.jedi-language-server
];
}