From e94a4dde3180e5c6fcff401868e4ee0ecae79df0 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 7 Oct 2023 10:19:56 +0100 Subject: [PATCH] Move font confit to flake.nix, add to stylix Change fonts to all use Fira family, Fira Sans for UI Fira Sans Mono for monospace and FiraCode still for Emacs --- flake.nix | 50 ++++++++++++++++++- home/hyprland/anyrun.nix | 2 +- home/hyprland/swaync/default.nix | 5 +- home/hyprland/swaync/style.css | 2 +- home/hyprland/waybar/style.css | 2 +- .../waybar/styles/colourful_bubbles.css | 2 +- home/hyprland/wlogout/default.nix | 4 ++ home/tmux.nix | 1 + system/hyprland.nix | 29 ----------- 9 files changed, 59 insertions(+), 38 deletions(-) diff --git a/flake.nix b/flake.nix index 752f2025..a559a4ae 100644 --- a/flake.nix +++ b/flake.nix @@ -118,9 +118,57 @@ image = ./wallpapers/waves/cat-waves.png; base16Scheme = "${inputs.catppuccin-base16}/base16/macchiato.yaml"; + fonts = { + emoji = { + name = "Noto Color Emoji"; + package = pkgs.noto-fonts-emoji; + }; + monospace = { + name = "Fira Sans Mono"; + package = pkgs.fira-mono; + }; + sansSerif = { + name = "Fira Sans"; + package = pkgs.fira; + }; + serif = { + name = "Fira Sans"; + package = pkgs.fira; + }; + }; + homeManagerIntegration.followSystem = true; targets = { + chromium.enable = true; console.enable = true; - grub.enable = true; + grub = { + enable = true; + useImage = true; + }; + }; + }; + fonts = { + packages = with pkgs; [ + fira + fira-mono + fira-code + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + dejavu_fonts + noto-fonts-emoji + font-awesome + material-symbols + emacs-all-the-icons-fonts + material-design-icons + weather-icons + vscode-extensions.file-icons.file-icons + ]; + fontconfig = { + enable = true; + defaultFonts = { + serif = [ "Fira Sans" "DejaVu Sans" ]; + sansSerif = [ "Fira Sans" "DejaVu Sans" ]; + monospace = [ "Fira Mono" "DejaVu Sans Mono" ]; + emoji = [ "Noto Color Emoji" ]; + }; }; }; nix = { diff --git a/home/hyprland/anyrun.nix b/home/hyprland/anyrun.nix index 86780bb2..2e4868ad 100644 --- a/home/hyprland/anyrun.nix +++ b/home/hyprland/anyrun.nix @@ -26,7 +26,7 @@ extraCss = '' * { all: unset; - font-family: FiraCode Nerd Font; + font-family: "Fira Sans"; font-size: 1.3rem; } diff --git a/home/hyprland/swaync/default.nix b/home/hyprland/swaync/default.nix index cbb71242..3d24ac4c 100644 --- a/home/hyprland/swaync/default.nix +++ b/home/hyprland/swaync/default.nix @@ -1,9 +1,6 @@ { pkgs, ... }: { - home.packages = [ - pkgs.swaynotificationcenter - (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }) - ]; + home.packages = [ pkgs.swaynotificationcenter ]; xdg.configFile."swaync/style.css".source = ./style.css; } diff --git a/home/hyprland/swaync/style.css b/home/hyprland/swaync/style.css index f1b8cdbe..711831f5 100644 --- a/home/hyprland/swaync/style.css +++ b/home/hyprland/swaync/style.css @@ -1,7 +1,7 @@ * { all: unset; font-size: 14px; - font-family: "FiraCode Nerd Font"; + font-family: "Fira Sans"; transition: 200ms; } diff --git a/home/hyprland/waybar/style.css b/home/hyprland/waybar/style.css index ec789c7a..9ceb5835 100644 --- a/home/hyprland/waybar/style.css +++ b/home/hyprland/waybar/style.css @@ -35,7 +35,7 @@ margin: 0px; background: transparent; color: @text; - font-family: "FiraCode Nerd Font"; + font-family: "Fira Sans"; font-size: 18px; } diff --git a/home/hyprland/waybar/styles/colourful_bubbles.css b/home/hyprland/waybar/styles/colourful_bubbles.css index 6959c4c5..238c0004 100644 --- a/home/hyprland/waybar/styles/colourful_bubbles.css +++ b/home/hyprland/waybar/styles/colourful_bubbles.css @@ -32,7 +32,7 @@ * { border: none; border-radius: 10px; - font-family: "FiraCode Nerd Font"; + font-family: "Fira Sans"; font-size: 18px; } diff --git a/home/hyprland/wlogout/default.nix b/home/hyprland/wlogout/default.nix index ae6cd60c..dd602eb8 100644 --- a/home/hyprland/wlogout/default.nix +++ b/home/hyprland/wlogout/default.nix @@ -28,6 +28,10 @@ rebootIcon = ./icons/reboot.png; logoutIcon = ./icons/logout.png; in '' + * { + font-family: "Fira Sans"; + } + window { background: transparent; } diff --git a/home/tmux.nix b/home/tmux.nix index 1fa785f4..53b979e9 100644 --- a/home/tmux.nix +++ b/home/tmux.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { + stylix.targets.tmux.enable = true; programs.tmux = { enable = true; baseIndex = 1; diff --git a/system/hyprland.nix b/system/hyprland.nix index b1472405..d5f00e89 100644 --- a/system/hyprland.nix +++ b/system/hyprland.nix @@ -32,35 +32,6 @@ tumbler.enable = true; xserver.displayManager.defaultSession = "hyprland"; }; - fonts = { - packages = with pkgs; [ - # normal fonts - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - font-awesome - # nerdfonts - (nerdfonts.override { fonts = [ "FiraCode" ]; }) - # icon fonts - material-symbols - emacs-all-the-icons-fonts - material-design-icons - weather-icons - vscode-extensions.file-icons.file-icons - ]; - fontconfig = { - enable = true; - # user defined fonts - # the reason there's Noto Color Emoji everywhere is to override DejaVu's - # B&W emojis that would sometimes show instead of some Color emojis - defaultFonts = { - serif = [ "Noto Serif" "Noto Color Emoji" ]; - sansSerif = [ "Noto Sans" "Noto Color Emoji" ]; - monospace = [ "FiraCode Nerd Font" "Noto Sans" "Noto Color Emoji" ]; - emoji = [ "Noto Color Emoji" ]; - }; - }; - }; xdg.portal = { enable = true; extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];