Add Windows 11 fonts

This commit is contained in:
Manuel Thalmann 2024-05-10 10:41:26 +02:00
parent 5cea22bf95
commit 11a125dd6d
2 changed files with 67 additions and 0 deletions

View file

@ -108,6 +108,72 @@
'';
};
ttf-ms-win11 = { fetchgit, fetchurl, pkgs, p7zip, stdenv, ... }:
let
name = "ttf-ms-win11";
iso = "win11.iso";
version = "10.0.22631.2428-2";
fonts = ''"''${_ttf_ms_win11[@]}"'';
ttf-ms-win11-auto =
stdenv.mkDerivation {
name = "${name}-auto";
inherit version;
src = fetchgit {
url = "https://aur.archlinux.org/ttf-ms-win11-auto.git";
rev = "aee165d1396b34000b07294d36f9c19812a186f7";
sha256 = "3QZP5j/q/BTwBLSULVACKJ7DRVh3w/wxKEOZc1Fo9Io=";
};
buildPhase = ''
mkdir $out
cp PKGBUILD $out/
'';
};
in
# Borrowed from https://aur.archlinux.org/packages/ttf-ms-win11-auto
stdenv.mkDerivation rec {
inherit
name
version
;
src = fetchurl {
url = "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/22631.2428.231001-0608.23H2_NI_RELEASE_SVC_REFRESH_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso";
name = "${name}.tar";
sha256 = "KpxK+LCq6FCwV607YH7nqQa415+jVYQ5lUnCL4MSXxk=";
downloadToTemp = true;
nativeBuildInputs = [
p7zip
];
postFetch = ''
mv $downloadedFile "${iso}"
echo "Downloaded file:"
ls -al
7z x "${iso}" sources/install.wim
echo "Files after extraction:"
ls -al
7z e sources/install.wim Windows/{Fonts/"*".{ttf,ttc},System32/Licenses/neutral/"*"/"*"/license.rtf}
. ${ttf-ms-win11-auto}/PKGBUILD
mkdir "${name}"
cp ${fonts} license.rtf "${name}"
tar -czvf $out \
--sort=name --format=posix --pax-option='delete=atime,delete=ctime' --clamp-mtime --mtime="$SOURCE_EPOCH" --numeric-owner --owner=0 --group=0 --mode='go+u,go-w' \
"${name}"
'';
};
installPhase = ''
runHook preInstall
. ${ttf-ms-win11-auto}/PKGBUILD
install -vDm644 ${fonts} -t $out/share/fonts/truetype
install -vDm644 license.rtf -t $out/share/licenses/${name}/
runHook postInstall
'';
};
xone = pkgs: xonePatcher {
inherit (pkgs) fetchFromGitHub;
inherit (pkgs.linuxPackages_latest) xone;

View file

@ -205,6 +205,7 @@
];
})
cascadia-code
ttf-ms-win11
];
};
}