diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2022-02-13 18:25:11 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2022-02-13 18:28:32 +0100 |
| commit | 54beaa1e0a62b76af0e45891bdd81f0c5fd4a32e (patch) | |
| tree | 87cc9ac7926e11543c79fd95b5d811247ddd1476 | |
| parent | 3ab5b9be665f1ad5892f3c234f4c767499479698 (diff) | |
add minted specific configuration
| -rw-r--r-- | modules/latex.nix | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/modules/latex.nix b/modules/latex.nix index d880605..4454f98 100644 --- a/modules/latex.nix +++ b/modules/latex.nix @@ -17,8 +17,8 @@ let // (optionalAttrs cfg.latexmk.enable { inherit (cfg.texlive) latexmk; }) // (optionalAttrs cfg.minted.enable { inherit (cfg.texlive) - minted catchfile etoolbox fancyvrb float framed fvextra ifplatform kvoptions - lineno pdftexcmds upquote xcolor xstring; + minted catchfile etoolbox fancyvrb float framed fvextra ifplatform + kvoptions lineno pdftexcmds upquote xcolor xstring; })); in { options.latex = { @@ -84,11 +84,22 @@ in { }; }; - minted.enable = mkEnableOption "minted"; + minted = { + enable = mkEnableOption "minted"; + pygments = mkOption { + type = types.package; + default = pkgs.pythonPackages.pygments; + defaultText = literalExample "pkgs.pythonPackages.pygments"; + description = '' + The package providing pygments. + ''; + }; + }; }; config = mkIf cfg.enable { - buildInputs = [ latexBuildInput ] ++ (optional cfg.latexmk.enable pkgs.ps); + buildInputs = [ latexBuildInput ] ++ (optional cfg.latexmk.enable pkgs.ps) + ++ (optional cfg.minted.enable cfg.minted.pygments); aliases.latexmk = mkIf cfg.latexmk.enable "${latexBuildInput}/bin/latexmk ${latexmkFlags} \\$@"; python = mkIf cfg.minted.enable { |
