fontconfig-penultimate: init at 0.2

Also provides a NixOS module.
This commit is contained in:
Thomas Tuegel 2017-03-12 17:06:44 -05:00
parent 65592837b6
commit 354ea69ae4
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59
4 changed files with 79 additions and 1 deletions

View File

@ -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 ];
};
}

View File

@ -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

View File

@ -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
'';
}

View File

@ -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 { };