Formatting
This commit is contained in:
parent
57d373b305
commit
fc54843031
4 changed files with 139 additions and 104 deletions
|
@ -1,48 +1,60 @@
|
|||
# inspired by https://flyx.org/nix-flakes-latex/
|
||||
{ description = "A latex template";
|
||||
{
|
||||
description = "A latex template";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils}:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
texInput = "main";
|
||||
# If you're not lazy, figure out what dependencies you need.
|
||||
# If you are lazy, just take the full scheme.
|
||||
tex = (pkgs.texlive.combine {
|
||||
inherit (pkgs.texlive) scheme-full;
|
||||
#scheme-basic latex-bin latexmk;
|
||||
});
|
||||
in {
|
||||
packages = rec {
|
||||
document = pkgs.stdenvNoCC.mkDerivation rec {
|
||||
pname = throw "put document name here";
|
||||
version = "0.0";
|
||||
src = ./src;
|
||||
buildInputs = [
|
||||
tex
|
||||
];
|
||||
buildPhase = ''
|
||||
mkdir -p .cache/texmf-var
|
||||
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
|
||||
latexmk -interaction=nonstopmode -lualatex \
|
||||
${texInput}.tex
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ${texInput}.pdf $out/${pname}.pdf
|
||||
'';
|
||||
};
|
||||
default = document;
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
texInput = "main";
|
||||
# If you're not lazy, figure out what dependencies you need.
|
||||
# If you are lazy, just take the full scheme.
|
||||
tex = (
|
||||
pkgs.texlive.combine {
|
||||
inherit (pkgs.texlive) scheme-full;
|
||||
#scheme-basic latex-bin latexmk;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
packages = rec {
|
||||
document = pkgs.stdenvNoCC.mkDerivation rec {
|
||||
pname = throw "put document name here";
|
||||
version = "0.0";
|
||||
src = ./src;
|
||||
buildInputs = [
|
||||
tex
|
||||
];
|
||||
buildPhase = ''
|
||||
mkdir -p .cache/texmf-var
|
||||
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
|
||||
latexmk -interaction=nonstopmode -lualatex \
|
||||
${texInput}.tex
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ${texInput}.pdf $out/${pname}.pdf
|
||||
'';
|
||||
};
|
||||
default = document;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
texlab # my language server of choice
|
||||
tex
|
||||
];
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
texlab # my language server of choice
|
||||
tex
|
||||
];
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue