diff options
author | Thomas Tuegel <ttuegel@mailbox.org> | 2017-03-12 17:06:44 -0500 |
---|---|---|
committer | Thomas Tuegel <ttuegel@mailbox.org> | 2017-03-17 13:50:05 -0500 |
commit | 354ea69ae42d2a1b691a4f3cb771e59141bd0dcd (patch) | |
tree | b6e7b55857d84905539f506b98a085dc6e7c00d9 | |
parent | 65592837b6e62fb555d6e8c891f347428886c4f2 (diff) |
fontconfig-penultimate: init at 0.2
Also provides a NixOS module.
-rw-r--r-- | nixos/modules/config/fonts/fontconfig-penultimate.nix | 57 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 3 | ||||
-rw-r--r-- | pkgs/data/fonts/fontconfig-penultimate/default.nix | 18 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
4 files changed, 79 insertions, 1 deletions
diff --git a/nixos/modules/config/fonts/fontconfig-penultimate.nix b/nixos/modules/config/fonts/fontconfig-penultimate.nix new file mode 100644 index 000000000000..8e41d3421173 --- /dev/null +++ b/nixos/modules/config/fonts/fontconfig-penultimate.nix @@ -0,0 +1,57 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.fonts.fontconfig.penultimate; + + latestVersion = pkgs.fontconfig.configVersion; + + # The configuration to be included in /etc/font/ + confPkg = pkgs.runCommand "font-penultimate-conf" {} '' + support_folder=$out/etc/fonts/conf.d + latest_folder=$out/etc/fonts/${latestVersion}/conf.d + + mkdir -p $support_folder + mkdir -p $latest_folder + + # fontconfig ultimate various configuration files + ln -s ${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/*.conf \ + $support_folder + ln -s ${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/*.conf \ + $latest_folder + ''; + +in +{ + + options = { + + fonts = { + + fontconfig = { + + penultimate = { + enable = mkOption { + type = types.bool; + default = true; + description = '' + Enable fontconfig-penultimate settings to supplement the + NixOS defaults by providing per-font rendering defaults and + metric aliases. + ''; + }; + }; + + }; + }; + + }; + + config = mkIf (config.fonts.fontconfig.enable && cfg.enable) { + + fonts.fontconfig.confPackages = [ confPkg ]; + + }; + +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7d2ae4a571c4..a938ba6d0069 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1,8 +1,9 @@ [ ./config/debug-info.nix ./config/fonts/corefonts.nix - ./config/fonts/fontconfig-ultimate.nix ./config/fonts/fontconfig.nix + ./config/fonts/fontconfig-penultimate.nix + ./config/fonts/fontconfig-ultimate.nix ./config/fonts/fontdir.nix ./config/fonts/fonts.nix ./config/fonts/ghostscript.nix diff --git a/pkgs/data/fonts/fontconfig-penultimate/default.nix b/pkgs/data/fonts/fontconfig-penultimate/default.nix new file mode 100644 index 000000000000..aea3365aba4b --- /dev/null +++ b/pkgs/data/fonts/fontconfig-penultimate/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchFromGitHub }: + +let version = "0.2"; in +stdenv.mkDerivation { + name = "fontconfig-penultimate-${version}"; + + src = fetchFromGitHub { + owner = "ttuegel"; + repo = "fontconfig-penultimate"; + rev = version; + sha256 = "106sjfmxdn2cachgsg0ky3wi676x6nd14y5fcl16n82kghi3d9yf"; + }; + + installPhase = '' + mkdir -p $out/etc/fonts/conf.d + cp *.conf $out/etc/fonts/conf.d + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f2eb80ec01d1..962506444fc6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7330,6 +7330,8 @@ with pkgs; fontconfig = callPackage ../development/libraries/fontconfig { }; + fontconfig-penultimate = callPackage ../data/fonts/fontconfig-penultimate {}; + fontconfig-ultimate = callPackage ../development/libraries/fontconfig-ultimate {}; folly = callPackage ../development/libraries/folly { }; |