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

iosevka-bin: add support for variants #101132

Merged
merged 1 commit into from Oct 30, 2020
Merged

Conversation

@deviant
Copy link
Member

@deviant deviant commented Oct 20, 2020

This adds the ability to select a specific prebuilt variant. It also adds
an updater script for generating their hashes. Additionally, switching
to TTC files reduces the package size by an order of magnitude.

Example usage:

fonts.fonts = with pkgs; [
  (iosevka-bin.override { variant = "ss10"; })
  (iosevka-bin.override { variant = "sparkle"; })
  (iosevka-bin.override { variant = "aile"; })
];
Motivation for this change

I've had this kicking around in my local nixpkgs for half a year now.
Figured other people would probably find it useful. ^^

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.
@alyssais
Copy link
Member

@alyssais alyssais commented Oct 26, 2020

Why the change from fetchurl to mkDerivation? (Wondering, it’s not necessarily a bad thing)

@deviant
Copy link
Member Author

@deviant deviant commented Oct 26, 2020

@alyssais using fetchzip requires either setting name to ttc-${_name}-${version}.zip, or passing --name $name-bin-$version to nix-prefetch-url (since the package name now affects the output hash, due to Nix incorporating the vanity part of store paths into its hashing logic). In addition, fetchzip cannot use pname/version, making the derivation even more messy.

@deviant
Copy link
Member Author

@deviant deviant commented Oct 26, 2020

Roughly the same number of lines are required for each, but the version using fetchzip is more complicated.

@deviant deviant force-pushed the iosevka-variants branch from 9a27b60 to 90a1a9e Oct 26, 2020
@deviant
Copy link
Member Author

@deviant deviant commented Oct 26, 2020

(bumped to 3.7.1)

This adds the ability to select a specific prebuilt variant. It also adds
an updater script for generating their hashes. Additionally, switching
to TTC files reduces the package size by an order of magnitude.

Example usage:

	fonts.fonts = with pkgs; [
	  (iosevka-bin.override { variant = "ss10"; })
	  (iosevka-bin.override { variant = "sparkle"; })
	  (iosevka-bin.override { variant = "aile"; })
	];
@deviant deviant force-pushed the iosevka-variants branch from 90a1a9e to d3025ee Oct 30, 2020
@worldofpeace worldofpeace merged commit ee9154c into NixOS:master Oct 30, 2020
19 checks passed
@deviant deviant deleted the iosevka-variants branch Oct 30, 2020
@AluisioASG AluisioASG mentioned this pull request Oct 30, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants