From 4a5ec3baebf42457ac571cdda696c4cab2c6e11f Mon Sep 17 00:00:00 2001 From: Quinn Unger Date: Mon, 27 Jul 2026 14:13:13 +0100 Subject: [PATCH] add leaf: a terminal markdown previewer --- flake.lock | 6 +++--- flake.nix | 1 + overlays.nix | 1 + pkgs/leaf.nix | 22 ++++++++++++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 pkgs/leaf.nix diff --git a/flake.lock b/flake.lock index bad1279..81f15f7 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1784011430, - "narHash": "sha256-lDebytrYdd47IBLwvNOD+6AGeoqZ78CIKlp70hzW280=", + "lastModified": 1785104993, + "narHash": "sha256-eKbrvPoAOFutbYMdbB3r5EQVmFxKv24iKqHPPUXA0gM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8eeec934ae0dbeca3d7868c059568a65c08b2fc3", + "rev": "8623c4c20aa4ca2f5fb81510d2944066c3fb0d96", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 960a3c4..a33c2af 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ { inherit (moppkgs) edalize + leaf naturaldocs slang-server ttf2psf diff --git a/overlays.nix b/overlays.nix index b0e6c75..eba8e05 100644 --- a/overlays.nix +++ b/overlays.nix @@ -1,6 +1,7 @@ let overlays = (builtins.mapAttrs (name: value: (final: prev: { "${name}" = value final prev; })) { + leaf = final: _: final.callPackage ./pkgs/leaf.nix { }; comic-code = final: _: final.callPackage ./pkgs/comic-code.nix { }; edalize = final: _: final.callPackage ./pkgs/edalize.nix { }; naturaldocs = final: _: final.callPackage ./pkgs/naturaldocs.nix { }; diff --git a/pkgs/leaf.nix b/pkgs/leaf.nix new file mode 100644 index 0000000..00651c3 --- /dev/null +++ b/pkgs/leaf.nix @@ -0,0 +1,22 @@ +{ + lib, + fetchFromGitHub, + rustPlatform, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "leaf"; + version = "1.26.2"; + src = fetchFromGitHub { + owner = "RivoLink"; + repo = "leaf"; + tag = finalAttrs.version; + hash = "sha256-i56BfHHkWl6gfhYXhrwEymlPTc+V4msnxlV7LSUy8X0="; + }; + cargoHash = "sha256-/IGQ0UTvQGU4KQKl5mocGeGEDx4AdMQQTv4B3bkpIJ0="; + meta = { + description = "Terminal Markdown previewer"; + homepage = "https://leaf.rivolink.mg"; + license = lib.licenses.mit; + maintainers = [ ]; + }; +}) -- 2.51.2