aboutsummaryrefslogtreecommitdiff
path: root/template/flake.nix
blob: 59878c123d305d6367f2a4e28632cd30a56a592e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
  description = "TeX project";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs";
    flake-parts.url = "github:hercules-ci/flake-parts";
    tex-shell.url = "git://git.mathematicaster.org/tex-shell";
    systems.url = "github:nix-systems/default";
  };

  outputs =
    inputs@{ self, flake-parts, ... }:
    flake-parts.lib.mkFlake { inherit self inputs; } {
      systems = import inputs.systems;

      imports = [ inputs.tex-shell.flakeModules.default ];

      perSystem =
        { pkgs, config, ... }:
        {

          texShell = {
            scheme = pkgs.texliveSmall;
            latexmk = {
              enable = true;
              rc = /* perl */ ''
                $out_dir = '.latex-build';
                $pdf_mode = 1;
                $pdflatex = 'pdflatex -interaction=nonstopmode %O %S';
              '';
            };
          };

          devShells.default = pkgs.mkShellNoCC { inputsFrom = [ config.texShell.build.devShell ]; };
        };
    };
}