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

terminus-font: enable characters variants switching #63724

Closed
wants to merge 1 commit into from
Closed

terminus-font: enable characters variants switching #63724

wants to merge 1 commit into from

Conversation

caadar
Copy link
Contributor

@caadar caadar commented Jun 24, 2019

Motivation for this change

Terminus font upstream provides patchset for characters variants (see homepage at http://terminus-font.sourceforge.net#variants).

Some alternative variants so common, that e.g. centered tilde is mentioned as "perhaps should be the default".

This PR adds useful ability to switch alternative terminus font variants by Nix.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@veprbl
Copy link
Member

veprbl commented Aug 1, 2019

cc @astsmtl

@caadar
Copy link
Contributor Author

caadar commented Oct 18, 2019

May be users should use something like

  nixpkgs.overlays = [(self: super: {
    terminus_font = super.terminus_font.overrideAttrs (_: {
      patchPhase = super.terminus_font.patchPhase + ''
        patch -p1 -i alt/ge2.diff
        patch -p1 -i alt/ij1.diff
        patch -p1 -i alt/ll2.diff
        patch -p1 -i alt/td1.diff
      '';
    });
  })];

and options for Terminus font not needed?

@caadar
Copy link
Contributor Author

caadar commented Nov 27, 2019

Not needed indeed. Just use overlays.

@caadar caadar closed this Nov 27, 2019
@caadar caadar deleted the add-terminus-font-characters-variants branch March 10, 2020 08:15
@jktjkt
Copy link
Contributor

jktjkt commented Oct 9, 2020

Just in case someone lands here when looking for these options, I'm posting what actually works for me on nixpkgs-unstable today. The way patches are managed has changed, that package doesn't use patchPhase, and it's now:

self: super:
{

  terminus_font = super.terminus_font.overrideAttrs (_: {
      patches = [
        "alt/ll2.diff"
	"alt/td1.diff"
      ];
    });
}

It's enough to put that into ~/.config/nixpkgs/overlays/extra-packages/default.nix.

I think this demonstrates quite nicely that there's some churn in these options, so I think adding per-package options is a cleaner option here. Too bad that even these options are apparently totally undocumented...

@sigprof
Copy link
Contributor

sigprof commented Jun 20, 2022

Note that the override in the comment above is subtly incorrect — it replaces the value of patches completely, but the current version of the terminus_font package actually has a patch inside, and that patch gets removed by the override.

The correct override should use (old.patches or []) to make sure that any Nixpkgs-provided patches are still applied:

self: super:
{
  terminus_font = super.terminus_font.overrideAttrs (old: {
      patches = (old.patches or []) ++ [
        "alt/ll2.diff"
	"alt/td1.diff"
      ];
    });
}

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