From 2a321e68002f846ea25b6e0f9e962776a24476c9 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 17 Apr 2021 12:51:32 +0530 Subject: init --- flake.nix | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..525ebc6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,57 @@ +{ + description = "Latex Project Report Template"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + utils.url = "github:numtide/flake-utils"; + gitignore = { + url = "github:hercules-ci/gitignore"; + flake = false; + }; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, utils, gitignore, ... }: + utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; + inherit (import gitignore { inherit (pkgs) lib; }) gitignoreSource; + nativeBuildInputs = with pkgs; [ + (texlive.combine { + inherit (texlive) + scheme-medium + multirow + hyperref + blindtext + fancyhdr + etoolbox + topiclongtable; + }) + gnumake + ]; + in + rec { + defaultPackage = stdenv.mkDerivation { + pname = "report"; + version = "0.1.0"; + src = gitignoreSource ./.; + buildInputs = nativeBuildInputs; + buildPhase = '' + latexmk -pdf \ + -pdflatex="pdflatex -interaction=nonstopmode" \ + -use-make + ${pname}.tex + ''; + installPhase = '' + mkdir -p $out + cp ${pname}.pdf $out/ + ''; + }; + devShell = pkgs.mkShell { + nativeBuildInputs = nativeBuildInputs; + }; + }); +} -- cgit v1.2.3