feat: Configure fonts
This commit is contained in:
@@ -30,6 +30,12 @@ let
|
|||||||
emacsCacheDir = "${emacsDataDir}/cache";
|
emacsCacheDir = "${emacsDataDir}/cache";
|
||||||
straightBaseDir = "${emacsDataDir}/straight";
|
straightBaseDir = "${emacsDataDir}/straight";
|
||||||
|
|
||||||
|
fontPackages = [
|
||||||
|
pkgs.julia-mono
|
||||||
|
(pkgs.nerdfonts.override { fonts = [ "VictorMono" ]; })
|
||||||
|
pkgs.overpass
|
||||||
|
];
|
||||||
|
|
||||||
emacsWrapper = pkgs.symlinkJoin {
|
emacsWrapper = pkgs.symlinkJoin {
|
||||||
name = "emacs-wrapper";
|
name = "emacs-wrapper";
|
||||||
paths = [ emacsPackage ];
|
paths = [ emacsPackage ];
|
||||||
@@ -38,12 +44,15 @@ let
|
|||||||
pkgs.git # Dependency of Straight.el.
|
pkgs.git # Dependency of Straight.el.
|
||||||
];
|
];
|
||||||
postBuild = ''
|
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
|
for i in $out/bin/emacs-*; do
|
||||||
wrapProgram "$i" \
|
wrapProgram "$i" \
|
||||||
--add-flags "--init-directory \"${emacsConfigDir}\"" \
|
--add-flags "--init-directory \"${emacsConfigDir}\"" \
|
||||||
--set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \
|
--set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \
|
||||||
--set EMACS_CACHE_DIR "${emacsCacheDir}" \
|
--set EMACS_CACHE_DIR "${emacsCacheDir}" \
|
||||||
--set EMACS_DATA_DIR "${emacsDataDir}"
|
--set EMACS_DATA_DIR "${emacsDataDir}" \
|
||||||
|
--prefix PATH : "${pkgs.git}/bin"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@@ -53,7 +62,13 @@ in {
|
|||||||
(lib.removePrefix config.home.homeDirectory straightBaseDir)
|
(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...
|
# TODO: Make sure this is using the right package for Emacs...
|
||||||
services.emacs = {
|
services.emacs = {
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
;;; syd-ui.el -*- lexical-binding: t; -*-
|
;;; syd-ui.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defvar syd-fixed-pitch-font
|
||||||
|
(font-spec :family "VictorMono NF" :size 13)
|
||||||
|
"Default fixed-pitch (monospace) font.")
|
||||||
|
|
||||||
|
(defvar syd-variable-pitch-font
|
||||||
|
(font-spec :family "Overpass" :size 15)
|
||||||
|
"Default variable-pitch font.")
|
||||||
|
|
||||||
;; Beautiful theme in dark and light.
|
;; Beautiful theme in dark and light.
|
||||||
(use-package kanagawa-themes
|
(use-package kanagawa-themes
|
||||||
:config
|
:config
|
||||||
(load-theme 'kanagawa-wave t))
|
(load-theme 'kanagawa-wave t))
|
||||||
|
|
||||||
;; Display (relative) line numbers only in prog-mode derivatives.
|
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
|
;; Display (relative) line numbers only in prog-mode derivatives.
|
||||||
:hook ((prog-mode-hook . display-line-numbers-mode))
|
:hook ((prog-mode-hook . display-line-numbers-mode))
|
||||||
:custom ((display-line-numbers-type 'relative)
|
:custom ((display-line-numbers-type 'relative)
|
||||||
;; Always ask "y/n"; never "yes/no".
|
;; Always ask "y/n"; never "yes/no".
|
||||||
@@ -28,9 +36,30 @@
|
|||||||
;; Disable the menu bar, scroll bar, and tool bar.
|
;; Disable the menu bar, scroll bar, and tool bar.
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
(tool-bar-mode -1))
|
(tool-bar-mode -1)
|
||||||
|
|
||||||
|
;; Configuring the defaults for newly-created frames:
|
||||||
|
;; Set default font.
|
||||||
|
;; (add-to-list 'default-frame-alist '(font . "VictorMono NF"))
|
||||||
|
;; Disable the titlebar and borders (decorations).
|
||||||
|
(add-to-list 'default-frame-alist '(undecorated . t))
|
||||||
|
;; Maximise the window.
|
||||||
|
;; (add-to-list 'default-frame-alist '(fullscreen . maximized))
|
||||||
|
|
||||||
|
;; Set the default font... again? No! Earlier, we said "when creating a new
|
||||||
|
;; frame use this font." This call instead defines the face used for
|
||||||
|
;; "default" text to use this font.
|
||||||
|
(set-face-attribute 'default nil :font syd-fixed-pitch-font)
|
||||||
|
|
||||||
|
(set-face-attribute 'variable-pitch nil :font syd-variable-pitch-font)
|
||||||
|
|
||||||
|
;; Use JuliaMono as a fallback for some glyphs that VictorMono does not cover.
|
||||||
|
(dolist (char-range '((#x0250 . #x02af) ; IPA extensions
|
||||||
|
(#x2200 . #x22FF))) ; Mathematical operators
|
||||||
|
(set-fontset-font "fontset-default" char-range "JuliaMono")))
|
||||||
|
|
||||||
(use-package persp-mode
|
(use-package persp-mode
|
||||||
|
:disabled
|
||||||
:unless noninteractive
|
:unless noninteractive
|
||||||
:commands persp-switch-to-buffer
|
:commands persp-switch-to-buffer
|
||||||
:hook (on-init-ui . persp-mode)
|
:hook (on-init-ui . persp-mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user