From 5539a175f8b8a793b36d3883901af744af86f331 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Wed, 15 Dec 2021 00:21:21 -0500 Subject: [PATCH] Refactored font. Flag. See previous commits. --- modules/default.nix | 1 - modules/fonts.nix | 24 ------------------------ modules/profiles/graphical.nix | 1 - modules/system/default.nix | 3 ++- modules/system/fonts.nix | 27 +++++++++++++++++++++++++++ 5 files changed, 29 insertions(+), 27 deletions(-) delete mode 100644 modules/fonts.nix create mode 100644 modules/system/fonts.nix diff --git a/modules/default.nix b/modules/default.nix index 1084584..0878b19 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -14,6 +14,5 @@ ./applications # TODO Refactor everything after this. ./cli.nix - ./fonts.nix ]; } diff --git a/modules/fonts.nix b/modules/fonts.nix deleted file mode 100644 index 75bca08..0000000 --- a/modules/fonts.nix +++ /dev/null @@ -1,24 +0,0 @@ -# Need to read? -{ config, pkgs, ... }: { - fonts = { - enableDefaultFonts = true; - fonts = with pkgs; [ - alegreya - fira-code - fira-code-symbols - hasklig - inter - liberation_ttf - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - ]; - fontconfig = { - defaultFonts = { - serif = [ "inter" ]; - sansSerif = [ "alegreya" ]; - monospace = [ "hasklig" ]; - }; - }; - }; -} diff --git a/modules/profiles/graphical.nix b/modules/profiles/graphical.nix index 427ca15..4fd6e96 100644 --- a/modules/profiles/graphical.nix +++ b/modules/profiles/graphical.nix @@ -6,7 +6,6 @@ in { ../applications/firefox.nix ../applications/nextcloud.nix ../cli.nix - ../fonts.nix ../system/gtk.nix ./minimal.nix ]; diff --git a/modules/system/default.nix b/modules/system/default.nix index 82ec425..c0f2965 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -1,3 +1,4 @@ { config, pkgs, ... }: { - imports = [ ./gtk.nix ./boot.nix ./xdg.nix ./flatpak.nix ./zfs.nix ]; + imports = + [ ./gtk.nix ./boot.nix ./xdg.nix ./flatpak.nix ./zfs.nix ./fonts.nix ]; } diff --git a/modules/system/fonts.nix b/modules/system/fonts.nix new file mode 100644 index 0000000..1a9b5ef --- /dev/null +++ b/modules/system/fonts.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: +let graphical = config.graphical; +in { + config = lib.mkIf graphical.enable { + fonts = { + enableDefaultFonts = true; + fonts = with pkgs; [ + alegreya + fira-code + fira-code-symbols + hasklig + inter + liberation_ttf + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + ]; + fontconfig = { + defaultFonts = { + serif = [ "inter" ]; + sansSerif = [ "alegreya" ]; + monospace = [ "hasklig" ]; + }; + }; + }; + }; +}