feat: Configure fonts

This commit is contained in:
Madeleine Sydney
2025-02-02 11:52:10 -07:00
parent ed588077de
commit 542d329c24
2 changed files with 48 additions and 4 deletions

View File

@@ -30,6 +30,12 @@ let
emacsCacheDir = "${emacsDataDir}/cache";
straightBaseDir = "${emacsDataDir}/straight";
fontPackages = [
pkgs.julia-mono
(pkgs.nerdfonts.override { fonts = [ "VictorMono" ]; })
pkgs.overpass
];
emacsWrapper = pkgs.symlinkJoin {
name = "emacs-wrapper";
paths = [ emacsPackage ];
@@ -38,12 +44,15 @@ let
pkgs.git # Dependency of Straight.el.
];
postBuild = ''
# The binary called `emacs` is actually a symlink to `emacs-«version»`, so
# we needn't wrap it.
for i in $out/bin/emacs-*; do
wrapProgram "$i" \
--add-flags "--init-directory \"${emacsConfigDir}\"" \
--set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \
--set EMACS_CACHE_DIR "${emacsCacheDir}" \
--set EMACS_DATA_DIR "${emacsDataDir}"
--set EMACS_DATA_DIR "${emacsDataDir}" \
--prefix PATH : "${pkgs.git}/bin"
done
'';
};
@@ -53,7 +62,13 @@ in {
(lib.removePrefix config.home.homeDirectory straightBaseDir)
];
home.packages = [ emacsWrapper ];
home.packages = [
emacsWrapper
] ++ fontPackages;
# There's probably a better place to put this, but the current setup demands
# Fontconfig for Emacs to find my fonts.
fonts.fontconfig.enable = true;
# TODO: Make sure this is using the right package for Emacs...
services.emacs = {