diff options
author | Aria <me@aria.rip> | 2023-09-25 16:16:21 +0100 |
---|---|---|
committer | Aria <me@aria.rip> | 2023-09-25 16:16:21 +0100 |
commit | 747029c9313f5b79d0ef19f9cddee79ae555dcdc (patch) | |
tree | 34aa451e4aef34a0485f24fad7e5db27aa1a5327 /flake.nix |
setup thesis template
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0fd39f0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + description = "Aria Shrimpton dissertation"; + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05; + }; + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + tex = pkgs.texlive.combine { + inherit + (pkgs.texlive) + scheme-small + microtype + sectsty + printlen + psnfss + helvetic + courier + latex-bin + latexmk + ; + }; + in rec { + devShells.${system}.default = pkgs.mkShell { + buildInputs = [tex pkgs.just]; + }; + packages.${system} = { + default = pkgs.stdenvNoCC.mkDerivation rec { + name = "thesis"; + src = ./thesis; + buildInputs = [pkgs.coreutils tex]; + phases = ["unpackPhase" "buildPhase" "installPhase"]; + buildPhase = '' + export PATH="${pkgs.lib.makeBinPath buildInputs}"; + mkdir -p .cache/texmf-var + env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \ + latexmk -interaction=nonstopmode -pdf -lualatex \ + document.tex + ''; + installPhase = '' + mkdir -p $out + cp document.pdf $out/ + ''; + }; + }; + }; +} |