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 22dbc09500 Move some config from home/default.nix and nixos system config
Add options to desktop.nix from home/default.nix that are
desktop-relevant.

Add mimeapp config back from nixos system config

Move fd, ripgrep to enabled programs, remmina to enable service

Emacs config now imports shell config to ensure requirements are met
instead of duplicating some

Move Zsh config into it's own file zsh.nix
2024-06-07 10:51:35 +01:00

175 lines
3.7 KiB
Nix

{
config,
pkgs,
fonts,
...
}: {
imports = [
../shell/default.nix
./python/default.nix
./lua/default.nix
];
services.emacs = {
enable = true;
package = config.programs.emacs.finalPackage;
defaultEditor = true;
client.enable = true;
socketActivation.enable = false;
startWithUserSession = true;
};
programs.emacs = {
# Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git
# git clone https://git.xenia.me.uk/pixelifytica/emacs.git ~/.emacs.d
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 = "90";
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}))
'';
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
diminish
ligature
page-break-lines
helpful
which-key
ace-window
link-hint
diff-hl
# Completion
cape
consult
consult-eglot
consult-flyspell
corfu
corfu-terminal
embark
embark-consult
marginalia
orderless
vertico
# Templates
tempel
license-templates
gitignore-templates
# spell-checking
flyspell-correct
# password-store
pass
password-store
# IDE
treesit-grammars.with-all-grammars
treesit-auto
flymake-popon
flymake-shellcheck
flymake-yamllint
apheleia
envrc
rainbow-delimiters
aggressive-indent
python-docstring
nix-mode
lua-mode
# Media
emms
# org-mode
org-roam
org-noter
org-journal
# org-cite
citar
citar-embark
# org-mode HTML export
htmlize
# Projects
ibuffer-project
magit
forge
treemacs
# Writing
markdown-mode
pandoc-mode
auctex
auctex-latexmk
latex-preview-pane
# Email
mu4e
# RSS feeds
elfeed
elfeed-org
elfeed-tube
];
};
home.packages = with pkgs; [
# Emacs requirements
imagemagick
languagetool
wordnet
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;})
python3Packages.pygments
# Development tools
## Linters
shellcheck
yamllint
## Formatters
alejandra
shfmt
ruff
isort
stylua
nodePackages.prettier
## Language servers
pyright
lua-language-server
];
}