about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-01-21 20:51:39 +0900
committersefidel <contact@sefidel.net>2022-01-21 20:51:39 +0900
commit2e52b80529b09829b67199bd888354a64c2578db (patch)
tree3d8d62c8262bce8994c4e874a05c140e2561b20f
parente76260f53696fe99b998ee0017a76b260418ad99 (diff)
downloadnixrc-2e52b80529b09829b67199bd888354a64c2578db.tar.gz
nixrc-2e52b80529b09829b67199bd888354a64c2578db.zip
nixos/alpha: install fonts system-wide
-rw-r--r--home/profiles/base/default.nix13
-rw-r--r--home/profiles/fonts/default.nix25
-rw-r--r--nixos/alpha/configuration.nix47
-rw-r--r--nixos/default.nix1
4 files changed, 73 insertions, 13 deletions
diff --git a/home/profiles/base/default.nix b/home/profiles/base/default.nix
index 8a675f2..d6042e8 100644
--- a/home/profiles/base/default.nix
+++ b/home/profiles/base/default.nix
@@ -72,21 +72,8 @@ in
       pkgs.sops
       pkgs.tree
       neovim
-
-      # Fonts
-      pkgs.iosevka-pure-bin
-      pkgs.dina-font
-      pkgs.sarasa-gothic
-      pkgs.scientifica
-      pkgs.jetbrains-mono
-      pkgs.twemoji-color-font
-      pkgs.symbola
-      pkgs.emacs-all-the-icons-fonts
-      (pkgs.nerdfonts.override { fonts = [ "Iosevka" "JetBrainsMono" ]; })
     ];
 
-    fonts.fontconfig.enable = true;
-
 
     wayland.windowManager.sway = {
       enable = true;
diff --git a/home/profiles/fonts/default.nix b/home/profiles/fonts/default.nix
new file mode 100644
index 0000000..ab24f31
--- /dev/null
+++ b/home/profiles/fonts/default.nix
@@ -0,0 +1,25 @@
+{ config, lib, pkgs, ... }:
+let cfg = config.profiles.fonts;
+in
+{
+  options.profiles.fonts = {
+    enable = lib.mkEnableOption
+      "A profile that installs extra fonts. (for Non-NixOS systems)";
+  };
+
+  config = lib.mkIf cfg.enable {
+    home.packages = with pkgs; [
+      iosevka-pure-bin
+      ctrld-font
+      sarasa-gothic
+      scientifica
+      #siji # TODO: bitmap font conflict
+      jetbrains-mono
+      twemoji-color-font
+      emacs-all-the-icons-fonts
+      (nerdfonts.override { fonts = [ "Iosevka" "JetBrainsMono" ]; })
+    ];
+
+    fonts.fontconfig.enable = true;
+  };
+}
diff --git a/nixos/alpha/configuration.nix b/nixos/alpha/configuration.nix
index dddd774..0825140 100644
--- a/nixos/alpha/configuration.nix
+++ b/nixos/alpha/configuration.nix
@@ -83,6 +83,53 @@
 
   systemd.extraConfig = "RebootWatchdogSec=5";
 
+  fonts = {
+    fontDir.enable = true;
+
+    fonts = with pkgs; [
+      iosevka-pure-bin
+      ctrld-font
+      sarasa-gothic
+      scientifica
+      siji
+      jetbrains-mono
+      twemoji-color-font
+      emacs-all-the-icons-fonts
+      (nerdfonts.override { fonts = [ "Iosevka" "JetBrainsMono" ]; })
+    ];
+
+    fontconfig = {
+      enable = true;
+
+      defaultFonts = {
+        serif = [
+          "Sarasa Gothic C"
+          "Sarasa Gothic J"
+          "Sarasa Gothic K"
+        ];
+
+        sansSerif = [
+          "Sarasa Gothic C"
+          "Sarasa Gothic J"
+          "Sarasa Gothic K"
+        ];
+
+        monospace = [
+          "CtrlD"
+          "scientifica"
+          "Iosevka Pure"
+          "Iosevka Nerd Font"
+          "JetBrainsMono Nerd Font"
+        ];
+
+        emoji = [
+          "Siji"
+          "Twitter Color Emoji"
+        ];
+      };
+    };
+  };
+
   programs = {
     sway = {
       enable = true;
diff --git a/nixos/default.nix b/nixos/default.nix
index 211f3d5..edf3622 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -4,6 +4,7 @@
   alpha = self.lib.mkSystem {
     name = "alpha";
     nixpkgs = nixpkgs;
+    overlays = with inputs; [ chaotic-nixpkgs.overlay ];
     extraModules = [
       inputs.sops-nix.nixosModules.sops
       ./modules/security.nix