NixOSConfig/lib/packages/ttf-ms-win11.nix

63 lines
2 KiB
Nix
Raw Normal View History

2024-05-10 09:49:30 +00:00
{ fetchgit, fetchurl, 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";
2024-06-11 23:31:46 +00:00
sha256 = "eTvlRiLw2DzQ9s4fQney4J13fcukuhqPotxs7w0+49Y=";
2024-05-10 09:49:30 +00:00
downloadToTemp = true;
nativeBuildInputs = [
p7zip
];
postFetch = ''
mv $downloadedFile "${iso}"
7z x "${iso}" sources/install.wim
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 \
2024-06-11 23:31:46 +00:00
--sort=name --format=posix --pax-option='delete=atime,delete=ctime' --clamp-mtime --mtime="$SOURCE_DATE_EPOCH" --numeric-owner --owner=0 --group=0 --mode='go+u,go-w' \
2024-05-10 09:49:30 +00:00
"${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
'';
}