From b13349f5d2785ca38141ee5a1717b826a7acfaf6 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 8 Dec 2021 13:09:23 +0100 Subject: loosely translate Python to shell --- README.md | 56 ++++++++++++++++---------------------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 1072dcf..57bde75 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,29 @@ -# tex2nix +# texnix + +_texnix is based on [tex2nix](https://github.com/Mic92/tex2nix)._ Generate Texlive environment containing all dependencies for your document rather than downloading gigabytes of texlive packages. -## Installation - -With stable nix you can do: - -``` console -nix-build && ./result/bin/tex2nix -``` - -If you use flakes put the following in your inputs - -```nix -{ - inputs.tex2nix.url = "github:Mic92/tex2nix"; - inputs.tex2nix.inputs.utils.follows = "nixpkgs"; -} -``` - -or just do: - -```console -$ nix run github:Mic92/tex2nix -``` - - -## USAGE +## Usage ```console -$ tex2nix main.tex -wrote tex-env.nix -$ cat tex-env.nix -# Generated with tex2nix 0.0.0 -{ texlive }: -(texlive.combine { - inherit (texlive) scheme-small; - "varwidth" = texlive."varwidth"; - "tabu" = texlive."tabu"; - -}) +$ echo '\usepackage{babel}' | texnix - +# Generated with texnix 1.0.0 +{ texlive, extraTexPackages ? {} }: +texlive.combine ({ + inherit (texlive) scheme-small; + "babel" = texlive."babel"; + "ctablestack" = texlive."ctablestack"; + "luatexbase" = texlive."luatexbase"; +} // extraTexPackages) ``` -tex2nix does not follow `\input` or `\include`. However you can specify multiple +texnix does not follow `\input` or `\include`. However you can specify multiple texfiles as input ```console -$ tex2nix *.tex +$ texnix *.tex > tex-env.nix ``` The resulting expression can be imported like this to in your document directory: @@ -56,7 +32,7 @@ The resulting expression can be imported like this to in your document directory # shell.nix with import {}; mkShell { - buildInputs = [ (pkgs.callPackage ./tex-env.nix {}) ]; + buildInputs = [ (callPackage ./tex-env.nix {}) ]; } ``` -- cgit v1.2.3