1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-09-11 12:49:18 +03:00

tests: avoid depending on an actual font package

This commit is contained in:
Daiderd Jordan 2018-10-12 22:02:56 +02:00
parent 9a04aea8ea
commit 5fa894c90a
No known key found for this signature in database
GPG Key ID: D02435D05B810C96

View File

@ -1,17 +1,20 @@
{ config, pkgs, ... }:
let
fonts = pkgs.runCommand "fonts-0.0.0" {} "mkdir -p $out";
in {
fonts = {
enableFontDir = true;
fonts = [ pkgs.dejavu_fonts ];
};
font = pkgs.runCommand "font-0.0.0" {} ''
mkdir -p $out/share/fonts
touch $out/share/fonts/Font.ttf
'';
in
{
fonts.enableFontDir = true;
fonts.fonts = [ font ];
test = ''
echo checking installed fonts >&2
grep -o "fontrestore default -n" ${config.out}/activate
grep -o "ln -fn '/run/current-system/sw/share/fonts/DejaVuSans.ttf' '/Library/Fonts/DejaVuSans.ttf'" ${config.out}/activate
grep -o "ln -fn '/run/current-system/sw/share/fonts/Font.ttf' '/Library/Fonts/Font.ttf'" ${config.out}/activate
'';
}