diff --git a/darwin/configuration.nix b/darwin/configuration.nix index 4554cd7..ef7e0bf 100644 --- a/darwin/configuration.nix +++ b/darwin/configuration.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { + imports = [ ../modules/personal/fonts ]; # List packages installed in system profile. To search by name, run: # $ nix-env -qaP | grep wget environment.systemPackages = @@ -28,6 +29,8 @@ # $ darwin-rebuild changelog system.stateVersion = 4; + # Font configuration + users.users.nki = { name = "nki"; home = "/Users/nki"; diff --git a/modules/personal/fonts/default.nix b/modules/personal/fonts/default.nix new file mode 100644 index 0000000..924c9cd --- /dev/null +++ b/modules/personal/fonts/default.nix @@ -0,0 +1,27 @@ +{ pkgs, lib, config, ... }: + +with lib; +{ + # Fonts + config.fonts = { + fonts = with pkgs; [ + noto-fonts-emoji-blob-bin + ibm-plex + (nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + noto-fonts + noto-fonts-cjk + ]; + } // (if (strings.hasSuffix "linux" pkgs.system) then { + enableDefaultFonts = false; + fontconfig = { + defaultFonts = { + emoji = lib.mkBefore [ "Blobmoji" ]; + serif = lib.mkBefore [ "IBM Plex Serif" ]; + sansSerif = lib.mkBefore [ "IBM Plex Sans" ]; + monospace = lib.mkBefore [ "IBM Plex Mono" ]; + }; + }; + } else {}) // (if (strings.hasSuffix "darwin" pkgs.system) then { + enableFontDir = true; + } else {}); +} diff --git a/nki-home/configuration.nix b/nki-home/configuration.nix index e302ac1..b1d513a 100644 --- a/nki-home/configuration.nix +++ b/nki-home/configuration.nix @@ -10,6 +10,8 @@ ./hardware-configuration.nix # secret management ./secrets + # Fonts + ../modules/personal/fonts ]; # Use the systemd-boot EFI boot loader. @@ -134,26 +136,6 @@ VISUAL = "kak"; }; - # Fonts - fonts = { - enableDefaultFonts = false; - fonts = with pkgs; [ - noto-fonts-emoji-blob-bin - ibm-plex - (nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) - noto-fonts - noto-fonts-cjk - ]; - fontconfig = { - defaultFonts = { - emoji = lib.mkBefore [ "Blobmoji" ]; - serif = lib.mkBefore [ "IBM Plex Serif" ]; - sansSerif = lib.mkBefore [ "IBM Plex Sans" ]; - monospace = lib.mkBefore [ "IBM Plex Mono" ]; - }; - }; - }; - # Enable Desktop Environment. services.xserver.displayManager = { lightdm.enable = true;