Last active
February 13, 2026 11:47
-
-
Save agoose77/73cf022e5d9f8ce99d8e9d5bff10e5d9 to your computer and use it in GitHub Desktop.
MyST Flake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "nodes": { | |
| "nixpkgs": { | |
| "locked": { | |
| "lastModified": 1770841267, | |
| "narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=", | |
| "owner": "nixos", | |
| "repo": "nixpkgs", | |
| "rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae", | |
| "type": "github" | |
| }, | |
| "original": { | |
| "owner": "nixos", | |
| "ref": "nixos-unstable", | |
| "repo": "nixpkgs", | |
| "type": "github" | |
| } | |
| }, | |
| "root": { | |
| "inputs": { | |
| "nixpkgs": "nixpkgs" | |
| } | |
| } | |
| }, | |
| "root": "root", | |
| "version": 7 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "MyST Document Engine"; | |
| inputs = { | |
| nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | |
| }; | |
| outputs = { | |
| self, | |
| nixpkgs, | |
| }: let | |
| forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; | |
| in { | |
| packages = forAllSystems (system: let | |
| pkgs = import nixpkgs {system = system;}; | |
| node = pkgs.nodejs_22; | |
| inherit (pkgs) lib stdenv; | |
| in rec { | |
| default = myst; | |
| myst = stdenv.mkDerivation { | |
| name = "myst"; | |
| nativeBuildInputs = [ | |
| pkgs.makeBinaryWrapper | |
| ]; | |
| installPhase = '' | |
| runHook preInstall | |
| install -D src/mystmd_py/myst.cjs $out/share/mystmd/myst.cjs | |
| # Create a wrapper around the node binary that sets PATH and prepends the script | |
| # This is more nix-like than just creating a wrapper shell script ourselves. | |
| makeBinaryWrapper ${lib.getExe node} "$out/bin/myst" \ | |
| --add-flags "$out/share/mystmd/myst.cjs" \ | |
| --prefix PATH : ${lib.makeBinPath [node]} | |
| runHook postInstall | |
| ''; | |
| src = pkgs.fetchPypi { | |
| pname = "mystmd"; | |
| version = "1.8.0"; | |
| hash = "sha256-G7uyguF7p67y7C+PfQAx1B2Pid2SZFeBmeYcZIcWDc4="; | |
| }; | |
| meta = { | |
| description = "The MyST Markdown Command Line interface."; | |
| homepage = "https://github.com/jupyter-book/mystmd"; | |
| license = lib.licenses.mit; | |
| platforms = lib.platforms.all; | |
| mainProgram = "myst"; | |
| }; | |
| }; | |
| }); | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment