-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
windows11-fonts: init at 10.0.26100.1742-3, windows10-fonts: init at 10.0.19045.2006-1 #315274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
For @Cryolitia's reviews in #313500 (comment) Tks, I have changed it to use outputs |
pkgs/top-level/all-packages.nix
Outdated
windows11-fonts = (callPackage ../data/fonts/windows-fonts { }).windows11; | ||
windows10-fonts = (callPackage ../data/fonts/windows-fonts { }).windows10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windows11-fonts = (callPackage ../data/fonts/windows-fonts { }).windows11; | |
windows10-fonts = (callPackage ../data/fonts/windows-fonts { }).windows10; | |
inherit (callPackage ../data/fonts/windows-fonts { }) windows10-fonts windows11-fonts; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tks, I have completed the modification
''install -Dm644 ${source.${name}} -t $'' | ||
+ name | ||
+ '' | ||
/share/fonts/truetype | ||
ln -s $'' | ||
+ name | ||
+ '' | ||
/share/fonts/truetype/*.{ttf,ttc} $out/share/fonts/truetype | ||
install -Dm644 Windows/System32/Licenses/neutral/*/*/license.rtf -t $'' | ||
+ name | ||
+ '' | ||
/share/licenses | ||
'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
''install -Dm644 ${source.${name}} -t $'' | |
+ name | |
+ '' | |
/share/fonts/truetype | |
ln -s $'' | |
+ name | |
+ '' | |
/share/fonts/truetype/*.{ttf,ttc} $out/share/fonts/truetype | |
install -Dm644 Windows/System32/Licenses/neutral/*/*/license.rtf -t $'' | |
+ name | |
+ '' | |
/share/licenses | |
'' | |
'' | |
install -Dm644 ${source.${name}} -t ${name}/share/fonts/truetype | |
ln -s ${name}/share/fonts/truetype/*.{ttf,ttc} $out/share/fonts/truetype | |
install -Dm644 Windows/System32/Licenses/neutral/*/*/license.rtf -t ${name}/share/licenses | |
'' |
if this is wrong, then it just proves that the code before was not easy to understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My source code is this:
''install -Dm644 ${source.${name}} -t $'' + name + ''/share/fonts/truetype
ln -s $'' + name + ''/share/fonts/truetype/*.{ttf,ttc} $out/share/fonts/truetype
install -Dm644 Windows/System32/Licenses/neutral/*/*/license.rtf -t $'' + name + '' /share/licenses
''
Because it needs to go through nixfmt-rfc-style, it becomes commit like this, I tried to change it, it should be much better if I declare a variable.
Current Code:
let
outHome = "$" + name;
in
(''
install -Dm644 ${source.${name}} -t ${outHome}/share/fonts/truetype
ln -s ${outHome}/share/fonts/truetype/*.{ttf,ttc} $out/share/fonts/truetype
install -Dm644 Windows/System32/Licenses/neutral/*/*/license.rtf -t ${outHome}/share/licenses
'')
|
||
src = fetchurl { inherit url sha256; }; | ||
|
||
outputs = [ "out" ] ++ builtins.attrNames source; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do an output for every font.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for every language, not every font. Many latin world user may not care CJK fonts at all, and CJK fonts are really big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, all default fonts are ~67.5M in total, 5 chinese fonts are ~84.5M in total.
stdenvNoCC.mkDerivation { | ||
inherit pname version desc; | ||
|
||
src = fetchurl { inherit url sha256; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src = fetchurl { inherit url sha256; }; | |
src = fetchurl { | |
inherit url sha256; | |
meta.license = lib.licenses.unfree; | |
}; |
just to make sure that we don't ever cache this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tks, I have added
pname = "windows11-fonts"; | ||
version = "10.0.22631.2428-2"; | ||
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"; | ||
sha256 = "sha256-yNvJa2HQTIsB+vbOB5T98zllx7NQ6qPrHmaXAZkClFw="; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sha256 = "sha256-yNvJa2HQTIsB+vbOB5T98zllx7NQ6qPrHmaXAZkClFw="; | |
hash = "sha256-yNvJa2HQTIsB+vbOB5T98zllx7NQ6qPrHmaXAZkClFw="; |
pname, | ||
version, | ||
url, | ||
sha256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sha256, | |
hash, |
windows11 = windows-fonts { | ||
pname = "windows11-fonts"; | ||
version = "10.0.22631.2428-2"; | ||
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the source of those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pkgs attempts to download fonts directly from Microsoft, by
retrieving selective parts of the Windows 10 Enterprise 90-day evaluation edition.
visit: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise
iso file: https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise
win11 is the same as above
visit: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-11-enterprise
iso file: https://www.microsoft.com/en-us/evalcenter/download-windows-11-enterprise
@@ -0,0 +1,164 @@ | |||
{ | |||
default = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to dedupe them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two spec are slightly different, so I split them into two to facilitate subsequent spec updates.
@SuperSandro2000 Please help review, thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just made aware of this PR and I'm interested especially for the commonly used CJK fonts found here. I hope you don't mind the really late comments
+ lib.strings.concatLines ( | ||
lib.lists.forEach (builtins.attrNames source) ( | ||
name: | ||
let | ||
outHome = "$" + name; | ||
in | ||
('' | ||
install -Dm644 ${source.${name}} -t ${outHome}/share/fonts/truetype | ||
ln -s ${outHome}/share/fonts/truetype/*.{ttf,ttc} $out/share/fonts/truetype | ||
install -Dm644 Windows/System32/Licenses/neutral/*/*/license.rtf -t ${outHome}/share/licenses | ||
'') | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recognize that it is probably subjective which one is more hedious than the other, but I don't like this code generation at all. I would replace this with __structuredAttrs = true;
. You can use an associative array to get output paths in that case. See another (rather, the only other?) example in Nixpkgs:
nixpkgs/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix
Lines 288 to 294 in 240db6a
for outputName in ''${!outputs[@]} ; do | |
if [[ -n ''${outputDrvs[$outputName]} ]] ; then | |
ln -s "''${outputDrvs[$outputName]}" "''${outputs[$outputName]}" | |
else | |
touch "''${outputs[$outputName]}" | |
fi | |
done |
However, the language list is still too complicated for bash associative arrays. I can see two options:
mapAttrs
them into an attrset of space-separated file names, do word split in bash- invert the map, make them
{ "font.ttf" = "language"; ... }
instead
version = "10.0.22631.2428-2"; | ||
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"; | ||
hash = "sha256-yNvJa2HQTIsB+vbOB5T98zllx7NQ6qPrHmaXAZkClFw="; | ||
desc = "Microsoft Windows 11 fonts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this end up being Some TrueType fonts from Microsoft Windows 11 fonts
with "fonts" twice? Is that intended?
Thank you so much for reviewing this PR! Your comments were very helpful, and I’ve made the suggested changes. Also, big thanks to @pluiedev for the assistance in completing this PR. I truly appreciate everyone’s time and support! |
…10.0.19045.2006-1
meta = { | ||
description = "Some TrueType fonts from ${os} (Arial, Bahnschrift, Calibri, ...)"; | ||
homepage = "https://learn.microsoft.com/typography/"; | ||
license = lib.licenses.unfree; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question of licensing, would you have to agree to the windows license? if so should that be a thing that a user would have to configure for because it's a custom license aka a EULA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would say we need to do the same as the msvc sdk by adding the windows licence to config.nix like https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/windows/msvcSdk/default.nix if this is the case
Description of changes
I want to add windows fonts, just like vista-fonts and ttf-ms-win11-auto
Sorry, I accidentally rebase. I'm really sorry. I didn't mean to do that. #313500
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.