Add icons and ligatures
diff --git a/overlays/ligaturize.nix b/overlays/ligaturize.nix
new file mode 100644
index 0000000..49d532c
--- /dev/null
+++ b/overlays/ligaturize.nix
@@ -0,0 +1,27 @@
+final: prev: let
+ lib = prev.lib;
+ fonts = ["roboto-mono"];
+ ligaturizer = prev.fetchFromGithub {
+ owner = "ToxicFrog";
+ repo = "Ligaturizer";
+ rev = "v5";
+ sha256 = lib.fakeSha256;
+ };
+in
+ lib.pipe fonts [
+ (builtins.map (name: {
+ inherit name;
+ value = prev.${name};
+ }))
+ (builtins.mapAttrs (name: value:
+ value.overrideAttrs (
+ prevAttrs: {
+ postPatch = prevAttrs.postPatch + ''
+ find $out -name "*.ttf" -exec fontforge -lang py -script ligaturize.py {} \;
+ find $out -name "*.otf" -exec fontforge -lang py -script ligaturize.py {} \;
+ false
+ '';
+ }
+ )))
+ builtins.listToAttrs
+ ]
diff --git a/packages/monocraft.nix b/packages/monocraft.nix
new file mode 100644
index 0000000..cff1079
--- /dev/null
+++ b/packages/monocraft.nix
@@ -0,0 +1,30 @@
+{
+ lib,
+ fetchFromGitHub,
+ stdenv
+}:
+stdenv.mkDerivation rec {
+ pname = "monocraft";
+ version = "1.2";
+
+ src = fetchFromGitHub {
+ owner = "IdreesInc";
+ repo = "Monocraft";
+ rev = "v${version}";
+ sha256 = "sha256-ePBxEVjzAJ7g6iAGIqPfgZ8bwtNILmyEVm0zD+xNN6k=";
+ };
+
+ dontBuild = true;
+
+ installPhase = ''
+ mkdir -p $out/bin $out/share/fonts/opentype
+ mv Monocraft.otf $out/share/fonts/opentype
+ '';
+
+ meta = with lib; {
+ description = "A programming font based on the typeface used in Minecraft";
+ homepage = "https://github.com/IdreesInc/Monocraft";
+ license = licenses.ofl;
+ maintainers = with maintainers; [minion3665];
+ };
+}
diff --git a/packages/octicons.nix b/packages/octicons.nix
new file mode 100644
index 0000000..35497bd
--- /dev/null
+++ b/packages/octicons.nix
@@ -0,0 +1,235 @@
+{
+ lib,
+ fetchFromGitHub,
+ stdenv,
+ fontforge,
+ writeFile,
+ useNerdfontsOffset ? false,
+}: let
+ codepoints = writeFile "codepoints.json" ''
+ {
+ "alert": 61485,
+ "arrow-down": 61503,
+ "arrow-left": 61504,
+ "arrow-right": 61502,
+ "arrow-small-down": 61600,
+ "arrow-small-left": 61601,
+ "arrow-small-right": 61553,
+ "arrow-small-up": 61599,
+ "arrow-up": 61501,
+ "beaker": 61661,
+ "bell": 61662,
+ "bold": 61666,
+ "book": 61447,
+ "bookmark": 61563,
+ "briefcase": 61651,
+ "broadcast": 61512,
+ "browser": 61637,
+ "bug": 61585,
+ "calendar": 61544,
+ "check": 61498,
+ "checklist": 61558,
+ "chevron-down": 61603,
+ "chevron-left": 61604,
+ "chevron-right": 61560,
+ "chevron-up": 61602,
+ "circle-slash": 61572,
+ "circuit-board": 61654,
+ "clippy": 61493,
+ "clock": 61510,
+ "cloud-download": 61451,
+ "cloud-upload": 61452,
+ "code": 61535,
+ "comment": 61483,
+ "comment-discussion": 61519,
+ "credit-card": 61509,
+ "dash": 61642,
+ "dashboard": 61565,
+ "database": 61590,
+ "device-camera": 61526,
+ "device-camera-video": 61527,
+ "device-desktop": 62076,
+ "device-mobile": 61496,
+ "desktop-download": 61660,
+ "diff": 61517,
+ "diff-added": 61547,
+ "diff-ignored": 61593,
+ "diff-modified": 61549,
+ "diff-removed": 61548,
+ "diff-renamed": 61550,
+ "ellipsis": 61594,
+ "eye": 61518,
+ "file-binary": 61588,
+ "file-code": 61456,
+ "file-directory": 61462,
+ "file-media": 61458,
+ "file-pdf": 61460,
+ "file-submodule": 61463,
+ "file-symlink-directory": 61617,
+ "file-symlink-file": 61616,
+ "file-text": 61457,
+ "file-zip": 61459,
+ "flame": 61650,
+ "fold": 61644,
+ "gear": 61487,
+ "gift": 61506,
+ "gist": 61454,
+ "gist-secret": 61580,
+ "git-branch": 61472,
+ "git-commit": 61471,
+ "git-compare": 61612,
+ "git-merge": 61475,
+ "git-pull-request": 61449,
+ "globe": 61622,
+ "graph": 61507,
+ "heart": 9829,
+ "history": 61566,
+ "home": 61581,
+ "horizontal-rule": 61552,
+ "hubot": 61597,
+ "inbox": 61647,
+ "info": 61529,
+ "issue-closed": 61480,
+ "issue-opened": 61478,
+ "issue-reopened": 61479,
+ "italic": 61668,
+ "jersey": 61465,
+ "key": 61513,
+ "keyboard": 61453,
+ "law": 61656,
+ "light-bulb": 61440,
+ "link": 61532,
+ "link-external": 61567,
+ "list-ordered": 61538,
+ "list-unordered": 61537,
+ "location": 61536,
+ "lock": 61546,
+ "logo-gist": 61613,
+ "logo-github": 61586,
+ "mail": 61499,
+ "mail-read": 61500,
+ "mail-reply": 61521,
+ "mark-github": 61450,
+ "markdown": 61641,
+ "megaphone": 61559,
+ "mention": 61630,
+ "milestone": 61557,
+ "mirror": 61476,
+ "mortar-board": 61655,
+ "mute": 61568,
+ "no-newline": 61596,
+ "octoface": 61448,
+ "organization": 61495,
+ "package": 61636,
+ "paintcan": 61649,
+ "pencil": 61528,
+ "person": 61464,
+ "pin": 61505,
+ "plug": 61652,
+ "plus": 61533,
+ "primitive-dot": 61522,
+ "primitive-square": 61523,
+ "pulse": 61573,
+ "question": 61484,
+ "quote": 61539,
+ "radio-tower": 61488,
+ "repo": 61441,
+ "repo-clone": 61516,
+ "repo-force-push": 61514,
+ "repo-forked": 61442,
+ "repo-pull": 61446,
+ "repo-push": 61445,
+ "rocket": 61491,
+ "rss": 61492,
+ "ruby": 61511,
+ "search": 61486,
+ "server": 61591,
+ "settings": 61564,
+ "shield": 61665,
+ "sign-in": 61494,
+ "sign-out": 61490,
+ "smiley": 61671,
+ "squirrel": 61618,
+ "star": 61482,
+ "stop": 61583,
+ "sync": 61575,
+ "tag": 61461,
+ "tasklist": 61669,
+ "telescope": 61576,
+ "terminal": 61640,
+ "text-size": 61667,
+ "three-bars": 61534,
+ "thumbsup": 61658,
+ "thumbsdown": 61659,
+ "tools": 61489,
+ "trashcan": 61648,
+ "triangle-down": 61531,
+ "triangle-left": 61508,
+ "triangle-right": 61530,
+ "triangle-up": 61610,
+ "unfold": 61497,
+ "unmute": 61626,
+ "unverified": 61672,
+ "verified": 61670,
+ "versions": 61540,
+ "watch": 61664,
+ "x": 61569,
+ "zap": 9889,
+ "ellipses": 61697,
+ "file": 61698,
+ "grabber": 61699,
+ "plus-small": 61700,
+ "reply": 61701
+ }
+ '';
+ script = writeFile "octicons.py" ''
+ import fontforge
+ import json
+
+ with open("${codepoints}/codepoints.json") as f:
+ codepoints = json.load(f)
+
+ font = fontforge.font()
+
+ for name, codepoint in enumerate(codepoints):
+ glyph = font.createChar(codepoint)
+ glyph.importOutlines(f"./icons/{name}-24.svg")
+
+ font.fontname = "octicons"
+
+ font.save("octicons.ttf")
+ '';
+in
+ rectdenv.mkDerivation rec {
+ pname = "octicons";
+ version = "17.5.0";
+
+ src = fetchFromGitHub {
+ owner = "primer";
+ repo = "octicons";
+ rev = "v${version}";
+ sha256 = lib.fakeSha256;
+ };
+
+ dontBuild = true;
+
+ buildPhase = ''
+ fontforge \
+ -lang py \
+ -script ${script}/octicons.py \;
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin $out/share/fonts/opentype
+ mv octicons.ttf $out/share/fonts/opentype
+ '';
+
+ nativeBuildInputs = [fontforge];
+
+ meta = with lib; {
+ description = "GitHub's Octicons icon pack";
+ homepage = "https://github.com/primer/octicons";
+ license = licenses.mit;
+ maintainers = with maintainers; [minion3665];
+ };
+ }