nixos/home/emacs/default.nix
Evie Litherland-Smith ecc9fae75a Major changes: switch to tracking nixos-23.11 and remove stylix.
Motivated by the xz backdoor bug, switch NixOS system to track 23.11
instead of unstable, and will bump version numbers as they come along
rather than do rolling release.
Reverted a couple of changes that were introduced in recent nixpkgs
versions, only major one was switching back to swaylock as hyprlock
isn't in nixpkgs 23.11

Remove stylix and replace with lower-level base16.nix, partly because
stylix was doing something strange pulling in extra flakes (and
breaking on 23.11), partly because I was most of the way there anyway.
Remove last references to stylix in config, mostly just changing
stylix.colors to scheme (from base16) and defining fonts in
specialArgs to be used in the same way as before.
2024-03-31 12:59:24 +01:00

173 lines
4 KiB
Nix

{
config,
pkgs,
fonts,
...
}: {
imports = [../git/default.nix ../prog/default.nix];
programs.git.extraConfig.core.editor = "$EDITOR";
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
catppuccin-theme
# spell-checking
flyspell-correct
consult-flyspell
# 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
tempel
tempel-collection
# ide-packages
treesit-grammars.with-all-grammars
treesit-auto
flymake-popon
flymake-collection
flymake-lua
flymake-ruff
flymake-clippy
flymake-eslint
flymake-shellcheck
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
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
doom-modeline
diminish
ligature
page-break-lines
helpful
which-key
link-hint
diff-hl
# 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
];
};
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
mupdf
poppler_utils
# Customised LaTeX install
(texlive.combine {
inherit (pkgs.texlive) scheme-medium dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of;
})
];
}