nixos/home/emacs/default.nix

174 lines
4.2 KiB
Nix
Raw Normal View History

2024-01-30 14:21:50 +00:00
{
config,
pkgs,
...
}: {
imports = [../git/default.nix ../prog/default.nix];
programs.git.extraConfig.core.editor = "${config.programs.emacs.finalPackage}/bin/emacsclient -c";
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 = with builtins;
with config; let
shell = "${pkgs.zsh}/bin/zsh";
font = "${stylix.fonts.monospace.name}-${toString stylix.fonts.sizes.applications}";
fixed-font-family = "${stylix.fonts.monospace.name}";
variable-font-family = "${stylix.fonts.sansSerif.name}";
alpha = "${toString (floor (mul stylix.opacity.applications 100))}";
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)
2024-02-21 07:25:40 +00:00
(menu-bar-mode -1)
'';
extraPackages = epkgs:
with epkgs; [
# theme
catppuccin-theme
# spell-checking
flyspell-correct
consult-flyspell
2023-12-19 14:46:57 +00:00
# password-store
password-store
password-store-otp
pass # password-store major mode
# completion-packages
cape
consult
consult-eglot
corfu
corfu-terminal
embark
embark-consult
marginalia
orderless
vertico
2024-02-21 06:41:28 +00:00
tempel
tempel-collection
# ide-packages
treesit-grammars.with-all-grammars
treesit-auto
2024-01-10 10:31:38 +00:00
flymake-popon
2024-02-16 17:12:07 +00:00
flymake-collection
flymake-shellcheck
2024-02-16 17:12:07 +00:00
flymake-clippy
flymake-ruff
flymake-eslint
apheleia
direnv
rainbow-delimiters
aggressive-indent
nix-mode
lua-mode
cargo
# media-packages
emms
# org-packages
org-roam
org-noter
org-journal
citar
citar-embark
2024-01-04 11:03:24 +00:00
gnuplot
# project-packages
2023-11-16 12:50:37 +00:00
ibuffer-project
magit
forge
# ui-packages
all-the-icons
nerd-icons
nerd-icons-completion
nerd-icons-corfu
nerd-icons-dired
nerd-icons-ibuffer
2024-02-29 15:36:27 +00:00
doom-modeline
2024-01-09 09:02:48 +00:00
diminish
2023-11-07 07:06:30 +00:00
ligature
page-break-lines
helpful
which-key
link-hint
2023-12-08 15:15:21 +00:00
diff-hl
2024-02-26 15:12:18 +00:00
dashboard
2024-02-03 08:10:23 +00:00
# Tree-Sitter packages
nushell-ts-mode
# 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
];
};
2024-02-10 06:45:31 +00:00
services = {
emacs = {
enable = true;
package = config.programs.emacs.finalPackage;
defaultEditor = true;
client.enable = true;
socketActivation.enable = true;
startWithUserSession = false;
2024-02-10 06:45:31 +00:00
};
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
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;
})
];
}