-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
nerd-font-patcher: init at 2.1.0 #142695
nerd-font-patcher: init at 2.1.0 #142695
Conversation
Does this have the same limitation as #124042 in that it downloads 2+ GB of tarball? |
Yes if fact, thanks for figuring out! I switched to the repo mentioned in ryanoasis/nerd-fonts#484 . |
using nerd-font-patcher in nixos was the sole reason i created that repo ;) |
|
||
patchPhase = '' | ||
sed -i font-patcher \ | ||
-e 's,__dir__ + "/src,"'$out'/share/${pname},' |
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.
-e 's,__dir__ + "/src,"'$out'/share/${pname},' | |
-e 's,__dir__ + "/src,"'$out'/share/nerd-font-patcher,' |
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 do not see how this improves the readability nor maintainability.
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.
Substitung pname all over the place makes it harder to understand what is going on because you need to substitute the variable in your head. This is an anti pattern and for many people including me this makes it harder to know what is going on.
Also the chance that the name of the program ever changes is very slim but that we change pname for organizational purposes is heigher which would break the package.
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 understand your point. From my perspective, I had a different feeling while writing the code, since pname is quite long.
Do we have a coding standard, where we can define and discuss such preferences?
mkdir -p $out/bin $out/share/${pname} | ||
install -Dm755 font-patcher $out/bin/${pname} | ||
cp -ra src/glyphs $out/share/${pname} |
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.
mkdir -p $out/bin $out/share/${pname} | |
install -Dm755 font-patcher $out/bin/${pname} | |
cp -ra src/glyphs $out/share/${pname} | |
mkdir -p $out/share/nerd-font-patcher | |
install -Dm755 font-patcher $out/bin/nerd-font-patcher | |
cp -ra src/glyphs $out/share/nerd-font-patcher |
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 do not see how this improves the readability nor maintainability.
Thanks for the recommended changes. I updated the commit. |
d646132
to
f3b984b
Compare
Are there examples on how to use this properly to patch a font? Maybe having a custom hook to patch fonts would be beneficial 🤔 |
@mainrs I have a working example here: https://codeberg.org/harrisonthorne/iosevka-muse/src/branch/main/flake.nix#L24 Is that what you're looking for? |
Yes! Thank you very much! |
@harrisonthorne Thanks for your example. I tried it with |
This depends on your inputs. I added a pinned version of By using a pinned version of |
EDIT: If you use the derivation described in the |
Motivation for this change
Package font-patcher from nerd fonts.
see also #124042
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)