diff options
Diffstat (limited to '')
-rwxr-xr-x | isabat | 12 | ||||
-rw-r--r-- | isabat.nix | 22 |
2 files changed, 34 insertions, 0 deletions
@@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ $# -eq 0 ] +then + echo "isabat: pretty-print isabelle theories on a terminal using bat." + echo "" + echo "please provide a .thy file to display." + exit +fi + +cat "$1" | isabelle2unicode | bat --file-name "$1" --theme TwoDark diff --git a/isabat.nix b/isabat.nix new file mode 100644 index 0000000..7fc05f2 --- /dev/null +++ b/isabat.nix @@ -0,0 +1,22 @@ +let + sources = import ./nix/sources.nix; + pkgs = import sources.nixpkgs {}; + isabelle-unicode = import ./default.nix; +in + +with pkgs; +stdenv.mkDerivation { + pname = "isabat"; + version = "0.1"; + + src = ./isabat; + + phases = [ "buildPhase" ]; + + buildPhase = '' + cp $src isabat + substituteInPlace isabat \ + --replace isabelle2unicode "${isabelle-unicode}/bin/isabelle2unicode" + cp isabat $out + ''; +} |