diff --git a/modules/default.nix b/modules/default.nix
index ab7b1065..d43831ee 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -13,6 +13,7 @@ let
modules = [
./home-environment.nix
./manual.nix
+ ./misc/fontconfig.nix
./misc/gtk.nix
./misc/news.nix
./misc/pam.nix
diff --git a/modules/misc/fontconfig.nix b/modules/misc/fontconfig.nix
new file mode 100644
index 00000000..aab29b67
--- /dev/null
+++ b/modules/misc/fontconfig.nix
@@ -0,0 +1,41 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.fonts.fontconfig;
+
+in
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ options = {
+ fonts.fontconfig = {
+ enableProfileFonts = mkOption {
+ type = types.bool;
+ default = false;
+ example = true;
+ description = ''
+ Configure fontconfig to discover fonts installed through
+ home.packages and
+ nix-env.
+
+ Note, this is only necessary on non-NixOS systems.
+ '';
+ };
+ };
+ };
+
+ config = mkIf cfg.enableProfileFonts {
+ home.file.".config/fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
+
+
+
+ ~/.nix-profile/lib/X11/fonts
+ ~/.nix-profile/share/fonts
+
+ '';
+ };
+}
diff --git a/modules/misc/news.nix b/modules/misc/news.nix
index ebda61cf..f0a41d7c 100644
--- a/modules/misc/news.nix
+++ b/modules/misc/news.nix
@@ -302,6 +302,21 @@ in
A new service is available: 'services.polybar'.
'';
}
+
+ {
+ time = "2017-10-09T16:38:34+00:00";
+ message = ''
+ A new module is available: 'fonts.fontconfig'.
+
+ In particular, the Boolean option
+
+ fonts.fontconfig.enableProfileFonts
+
+ was added for those who do not use NixOS and want to install
+ font packages using 'nix-env' or 'home.packages'. If you are
+ using NixOS then you do not need to enable this option.
+ '';
+ }
];
};
}