Skip to content

Commit

Permalink
feat: use custom build of Iosevka and ligature.el
Browse files Browse the repository at this point in the history
  • Loading branch information
yurrriq committed Nov 20, 2023
1 parent b06cc59 commit 8f4d996
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 21 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.11.4
8.12.0
2 changes: 1 addition & 1 deletion config/dunst.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
};
settings = {
global = {
font = "Iosevka Nerd Font 10";
font = "Iosevka Custom 10";
markup = "yes";
plain_text = "no";
format = "<b>%s</b>\\n%b";
Expand Down
13 changes: 12 additions & 1 deletion config/emacs/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(menu-bar-mode 0)
(scroll-bar-mode 0)
(tool-bar-mode 0)
(set-face-attribute 'default t :family "Iosevka Nerd Font Mono" :height 110)
(set-face-attribute 'default t :family "Iosevka Custom" :height 110)
(require 'package)
(setq-default frames-only-mode t
indent-tabs-mode nil
Expand Down Expand Up @@ -133,6 +133,17 @@ Null prefix argument turns off the mode."
(use-package hl-todo
:demand
:config (global-hl-todo-mode t))
(use-package ligature
:config
(ligature-set-ligatures
'prog-mode
'("-<<" "-<" "-<-" "<--" "<---" "<<-" "<-" "->" "->>" "-->" "--->" "->-" ">-" ">>-"
"=<<" "=<" "=<=" "<==" "<<=" "<=" "=>" "=>>" "==>" "===>" "=>=" ">=" ">>="
"<->" "<-->" "<--->" "<---->" "<=>" "<==>" "<===>" "<====>" "::" ":::" "__"
"<~~" "</" "</>" "/>" "~~>" "==" "!=" "/=" "~=" "<>" "===" "!==" "!===" "=/=" "=!="
"<:" ":=" "*=" "*+" "<*" "<*>" "*>" "<|" "<|>" "|>" "<." "<.>" ".>" "+*" "=*" "=:" ":>"
"(*" "*)" "/*" "*/" "[|" "|]" "{|" "|}" "++" "+++" "\\/" "/\\" "|-" "-|" "<!--" "<!---"))
(global-ligature-mode t))
(use-package magit
:demand
;; FIXME: :config (global-magit-file-mode t)
Expand Down
2 changes: 1 addition & 1 deletion config/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
(nerdfonts.override { fonts = [ "Iosevka" ]; })
iosevka-custom
];
}
4 changes: 2 additions & 2 deletions config/kitty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
include theme.conf
'';
font = {
name = "Iosevka Nerd Font Mono";
package = (pkgs.nerdfonts.override { fonts = [ "Iosevka" ]; });
name = "Iosevka Custom";
package = pkgs.iosevka-custom;
};
keybindings = {
"kitty_mod+enter" = "new_window_with_cwd";
Expand Down
2 changes: 1 addition & 1 deletion config/rofi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

programs.rofi = {
enable = true;
font = "Iosevka Nerd Font 18";
font = "Iosevka Custom 18";
pass = {
enable = true;
extraConfig = ''
Expand Down
2 changes: 1 addition & 1 deletion config/xmobar/xmobarrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Config
{ font = "Iosevka Nerd Font 24",
{ font = "Iosevka Custom 24",
additionalFonts = ["Noto Color Emoji 24"],
allDesktops = True,
bgColor = "#242424",
Expand Down
2 changes: 1 addition & 1 deletion config/xmonad/emacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(global-set-key (kbd "C-x C-k") 'kill-this-buffer)
(global-set-key (kbd "s-u") 'revert-buffer)

(set-face-attribute 'default nil :family "Iosevka Nerd Font Mono" :height 110)
(set-face-attribute 'default nil :family "Iosevka Custom" :height 110)

(eval-when-compile
(require 'use-package))
Expand Down
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv
, nix-gitignore
, makeFontsConf
, iosevka
, iosevka-custom
, gawk
, noweb
, python3Packages
Expand All @@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
] ./.;

FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ iosevka ];
fontDirectories = [ iosevka-custom ];
};

configurePhase = ''
Expand Down
17 changes: 17 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@
lib.composeManyExtensions
(lib.attrValues
(lib.filterAttrs (name: _: name != "default") self.overlays));
iosevka-custom = final: prev: {
# https://typeof.net/Iosevka/customizer
iosevka-custom = prev.iosevka.override {
privateBuildPlan = ''
[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "sans"
export-glyph-names = true
[buildPlans.iosevka-custom.ligations]
inherits = "dlig"
'';
set = "custom";
};
};
home-manager = final: prev: {
home-manager = inputs.home-manager.packages.${prev.system}.home-manager;
};
Expand Down Expand Up @@ -191,6 +206,7 @@
overlays = [
inputs.emacs-overlay.overlay
self.overlays.home-manager
self.overlays.iosevka-custom
self.overlays.noweb
];
inherit system;
Expand Down Expand Up @@ -298,6 +314,7 @@
};
packages = {
default = self.packages.${system}.yurrriq-dotfiles;
inherit (pkgs) iosevka-custom;
yurrriq-dotfiles = pkgs.callPackage ./. { };
};
});
Expand Down
2 changes: 1 addition & 1 deletion src/config/dunst.nw
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ iconTheme = {
@

<<Configure Dunst global settings>>=
font = "Iosevka Nerd Font 10";
font = "Iosevka Custom 10";
markup = "yes";
plain_text = "no";
format = "<b>%s</b>\\n%b";
Expand Down
18 changes: 17 additions & 1 deletion src/config/emacs/init.nw
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@

<<config/emacs/init.el>>=
(set-face-attribute 'default t :family "Iosevka Nerd Font Mono" :height 110)
(set-face-attribute 'default t :family "Iosevka Custom" :height 110)
@

<<config/emacs/init.el>>=
Expand Down Expand Up @@ -222,6 +222,22 @@ Null prefix argument turns off the mode."
:config (global-hl-todo-mode t))
@

Use \hrefootnote{https://github.com/mickeynp/ligature.el}{ligature.el} for
pretty ligatures.
<<config/emacs/init.el>>=
(use-package ligature
:config
(ligature-set-ligatures
'prog-mode
'("-@<<" "-<" "-<-" "<--" "<---" "@<<-" "<-" "->" "->>" "-->" "--->" "->-" ">-" ">>-"
"=@<<" "=<" "=<=" "<==" "@<<=" "<=" "=>" "=>>" "==>" "===>" "=>=" ">=" ">>="
"<->" "<-->" "<--->" "<---->" "<=>" "<==>" "<===>" "<====>" "::" ":::" "__"
"<~~" "</" "</>" "/>" "~~>" "==" "!=" "/=" "~=" "<>" "===" "!==" "!===" "=/=" "=!="
"<:" ":=" "*=" "*+" "<*" "<*>" "*>" "<|" "<|>" "|>" "<." "<.>" ".>" "+*" "=*" "=:" ":>"
"(*" "*)" "/*" "*/" "[|" "|]" "{|" "|}" "++" "+++" "\\/" "/\\" "|-" "-|" "<!--" "<!---"))
(global-ligature-mode t))
@

<<config/emacs/init.el>>=
(use-package magit
:demand
Expand Down
2 changes: 1 addition & 1 deletion src/config/fonts.nw
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
(nerdfonts.override { fonts = [ "Iosevka" ]; })
iosevka-custom
];
}
@
4 changes: 2 additions & 2 deletions src/config/kitty.nw
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
include theme.conf
'';
font = {
name = "Iosevka Nerd Font Mono";
package = (pkgs.nerdfonts.override { fonts = [ "Iosevka" ]; });
name = "Iosevka Custom";
package = pkgs.iosevka-custom;
};
keybindings = {
"kitty_mod+enter" = "new_window_with_cwd";
Expand Down
2 changes: 1 addition & 1 deletion src/config/rofi.nw
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

programs.rofi = {
enable = true;
font = "Iosevka Nerd Font 18";
font = "Iosevka Custom 18";
pass = {
enable = true;
extraConfig = ''
Expand Down
26 changes: 25 additions & 1 deletion src/flake.nw
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,16 @@ overlays = {

\subsection{Per-system pkgs}

For each \nix{system}, define a package collection that composes the overlays from \nix{deadnix} and \nix{emacs-overlay}, as well as the locally-defined \nix{home-manager} and \nix{noweb} overlays.
For each \nix{system}, define a package collection that composes the overlays
from \nix{deadnix} and \nix{emacs-overlay}, as well as the locally-defined
\nix{home-manager}, \nix{iosevka-custom}, and \nix{noweb} overlays.

<<per-system outputs variables>>=
pkgs = import inputs.nixpkgs {
overlays = [
inputs.emacs-overlay.overlay
self.overlays.home-manager
self.overlays.iosevka-custom
self.overlays.noweb
];
inherit system;
Expand Down Expand Up @@ -366,6 +369,7 @@ The default package builds
<<per-system outputs>>=
packages = {
default = self.packages.${system}.yurrriq-dotfiles;
inherit (pkgs) iosevka-custom;
yurrriq-dotfiles = pkgs.callPackage ./. { };
};
@
Expand Down Expand Up @@ -491,6 +495,26 @@ pkgNameElem = names: pkg:

\subsection{Overlays}

Define a custom build of \hrefootnote{}{Iosevka}.

<<overlays>>=
iosevka-custom = final: prev: {
# https://typeof.net/Iosevka/customizer
iosevka-custom = prev.iosevka.override {
privateBuildPlan = ''
[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "sans"
export-glyph-names = true
[buildPlans.iosevka-custom.ligations]
inherits = "dlig"
'';
set = "custom";
};
};
@

Define an overlay with a pinned version of home-manager.

<<overlays>>=
Expand Down
4 changes: 2 additions & 2 deletions src/packages.nw
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{ stdenv
, nix-gitignore
, makeFontsConf
, iosevka
, iosevka-custom
, gawk
, noweb
, python3Packages
Expand All @@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
] ./.;

FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ iosevka ];
fontDirectories = [ iosevka-custom ];
};

configurePhase = ''
Expand Down
2 changes: 1 addition & 1 deletion src/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
\renewcommand{\dateseparator}{.}

\usepackage{fontspec}
\setmonofont[Mapping=tex-text,Scale]{Iosevka}
\setmonofont[Mapping=tex-text,Scale]{Iosevka Custom}

\usepackage{hyperref}
\newcommand{\hrefootnote}[2]{\href{#1}{#2}\footnote{\url{#1}}}
Expand Down

0 comments on commit 8f4d996

Please sign in to comment.