tonsky / tonsky/FiraCode

Feature: Shorten the Nix paths

Open
#1,449 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
82k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

The Nix package management relies on hash (sha256) in file names and path names for its core functionality. For example:

/nix/store/nmv9xdibyaw71a3vq2skaapzif6cb8n1-vim-darwin-8.2.4350/share/vim/vimfiles

Seeing these hash names in our output just clutters the screen, does not provide much value, and in fact causes information to be missed by the reader/people. For example, following is the content of 'runtimepath' variable in my Vim session. It's very easy to miss the various values, because the comma separates the values, but the sha256 hashes make the values unreadable.

runtimepath=/nix/store/nmv9xdibyaw71a3vq2skaapzif6cb8n1-vim-darwin-8.2.4350/share/vim/vimfiles,/nix/store/nmv9xdibyaw71a3vq2skaapzif6cb8n1-vim-darwin-8.2.4350/share/vim/vim82,/nix/store/nmv9xdibyaw71a3vq2skaapzif6cb8n1-vim-darwin-8.2.4350/share/vim/vimfiles/after

I would like the display to be compact, so that the same output would look like:

runtimepath=/nix/store/nmv...-vim-darwin-8.2.4350/share/vim/vimfiles,/nix/store/nmv...-vim-darwin-8.2.4350/share/vim/vim82,/nix/store/nmv...-vim-darwin-8.2.4350/share/vim/vimfiles/after

I think a font, like FirCode, is ideal for this kind of compaction, rather than change the Nix tooling to do the same work. Since doing so via fonts won't clutter the screen visually, but when copied-pasted, the information will be retained.

I was wondering if FiraCode could be customized to achieve this kind of compaction. I looked for instructions to add one's own glyphs, etc., but could not find any instructions on how to do it. Typically a project contains instructions on how to contribute, and those seem to be missing from this project; at least I could not easily find them.

Ideally, we'd like the strings of format /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx to be shortened to /nix/store/xxx....

Another example of how the output would change, before and after the requested feature.

Before:

$ ls -1 /nix/store/ | head
00sgasgxp8jxgj87zmdmzljb18v0hc48-xz-5.2.5
026l3vp2pwb3nryx99clka9565ppf8y3-ruby2.7.5-wdm-0.1.1
0286s0vppcdk3zlxa8pvx098h58zf5kc-ensure-newer-sources-hook.sh.drv
0548jxy8by325jhwn7xzs7bxnpxrj3fg-httpclient-2.8.3.gem.drv
05hbwlry4adliqyl7s5nvr1h6vyyfj83-ruby2.7.5-rexml-3.2.5
05rf5hxbih4ssngvqcb5mna4p8ds2xyy-hook.drv
0631vf1bz8gkw4j1llvid53qxnjsxz5h-compiler-rt-11.1.0.src.tar.xz.drv
07qb0ariqsmkdisa4w8zlfigj9wq6vq8-bsdmake-24.drv
07y7nmv5miwnf985qc335zfmnd6j7gbq-tcl-8.6.11.drv
07zngbds28lwjnk1ix103bqlls9mrq6i-Test-Warn-0.36.tar.gz.drv

After:

$ ls -1 /nix/store/ | head
00s...-xz-5.2.5
026...-ruby2.7.5-wdm-0.1.1
028...-ensure-newer-sources-hook.sh.drv
054...-httpclient-2.8.3.gem.drv
05h...-ruby2.7.5-rexml-3.2.5
05r...-hook.drv
063...-compiler-rt-11.1.0.src.tar.xz.drv
07q...-bsdmake-24.drv
07y...-tcl-8.6.11.drv
07z...-Test-Warn-0.36.tar.gz.drv

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reviewing the repository's contribution guidance, which the issue says is missing, and investigate whether FiraCode's glyph customization can shorten Nix store paths visually while preserving the full copied text. Done means the example paths render compactly and copy-paste retains their original hashes.

Written by the indexing model from the issue text.

Assessment

Domain
design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.