Skip to content
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

Alegreya #90245

Merged
merged 2 commits into from Jul 8, 2020
Merged

Alegreya #90245

merged 2 commits into from Jul 8, 2020

Conversation

Thra11
Copy link
Member

@Thra11 Thra11 commented Jun 13, 2020

Motivation for this change

Package a couple of really nice fonts

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@puzzlewolf
Copy link
Contributor

Thanks for packaging these amazing fonts, I didn't know them before 😄

During review of my own fonts package #83537, it came up that mkDerivation should be used to create font derivations, instead of fetchzip.
Using fetchzip directly has the disadvantage that it makes it impossible to override these derivations with <font>.overrideAttrs. Also, it's odd to use fetchzip but override the builtin unpacking :)

@Thra11
Copy link
Member Author

Thra11 commented Jun 15, 2020

Thanks for the heads up! I'll change it to use mkDerivation.

@Thra11
Copy link
Member Author

Thra11 commented Jun 15, 2020

I wonder if we could write a section about packaging fonts in the manual. I looked there for guidelines on packaging fonts before copying an existing package. Other questions I would have liked answers to:

  • Should font variants be packaged individually or together (common to have serif and sans versions, as in this PR) (Perhaps they should even be grouped by foundry?)
  • Where multiple formats are available (e.g. otf, ttf, woff), should we choose a format or package all of them? If the latter, should they all be in a single package? or separated into fontname-ttf, fontname-otf, etc.?
  • What should the package name be? Just the font name? fontname-font? fontname-tff?
  • Any guidelines on what makes a font a good candidate for inclusion in nixpkgs. Only a tiny percentage of fonts are packaged at the moment, but I assume we don't want to package every font we can find.

I don't have any strong opinions on any of these issues. I just want to be able to follow some guidelines. I think guidelines make new contributors feel more confident, and thus more welcome (when you start a new job, it's nice to be told exactly what to do: you don't want to be left wondering whether you're doing the right thing).

@Thra11
Copy link
Member Author

Thra11 commented Jun 15, 2020

The other thing I wanted to know:

  • Whether it's ok to not have a version, given that many fonts don't publish a version number.

@puzzlewolf
Copy link
Contributor

Yes, I would have liked such a chapter too!

Do you mind posting at https://discourse.nixos.org/ to make this discussion more visible?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/guidelines-on-packaging-fonts/7683/1

@Thra11
Copy link
Member Author

Thra11 commented Jun 15, 2020

Things changed:

  • replaced fetchzip with mkDerivation
  • now fetches from the foundry's github repo instead of their website
  • which means it now has a proper version

@Thra11 Thra11 marked this pull request as ready for review June 15, 2020 21:30
@Thra11
Copy link
Member Author

Thra11 commented Jul 7, 2020

/marvin opt-in
/status needs_reviewer

@marvin-mk2 marvin-mk2 bot added the marvin label Jul 7, 2020
@marvin-mk2
Copy link

marvin-mk2 bot commented Jul 7, 2020

Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here.

Copy link
Contributor

@puzzlewolf puzzlewolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the nitpick is a matter of taste :)

pkgs/data/fonts/alegreya-sans/default.nix Outdated Show resolved Hide resolved
@puzzlewolf
Copy link
Contributor

/status needs_merger

@romildo romildo merged commit 61d1be7 into NixOS:master Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants