Browse Source

Update style of default.nix for building PDFs

Samuel W. Flint 3 years ago
parent
commit
a4a7c7a206
1 changed files with 15 additions and 23 deletions
  1. 15 23
      default.nix

+ 15 - 23
default.nix

@@ -1,33 +1,25 @@
-{ nixpkgs ? import <nixpkgs>{} }:
+{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; } }:
+let
+  tex = pkgs.texlive.combine {
+    inherit (pkgs.texlive)
 
-with nixpkgs;
+      scheme-small
+      latexmk
 
-stdenv.mkDerivation rec {
+      ;
+  };
+
+  gitignoreSource = pkgs.nix-gitignore.gitignoreFilterSourcePure (_: _: true);
+
+in
+pkgs.stdenv.mkDerivation rec {
 
   name = "document";
 
-  src = ./.;
+  src = gitignoreSource ./.gitignore ./.;
 
   buildInputs = [
-    (texlive.combine {
-      inherit (texlive)
-        scheme-small
-
-      # Directly required packages
-        latexmk
-        csquotes
-        everypage
-        marginnote
-        glossaries
-
-      # Apparently required
-        mfirstuc
-        xfor
-        datatool
-        substr
-        tracklang
-      ;    
-    })
+    tex
   ];
 
   buildPhase = "make";