From 360c8a636b8f51c45689cc1518a628383f24420b Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Sun, 17 Sep 2023 20:15:58 +0200 Subject: flake: use my-nixpkgs' devenv --- default.nix | 59 +++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 6385c9d..cd092f9 100644 --- a/default.nix +++ b/default.nix @@ -1,33 +1,64 @@ -{ pkgs, latex, data }: - -let +{ + pkgs, + latex, + data, +}: let commonArgs = { inherit data latex make; inherit (pkgs) lib; }; - make = path: overrides: - let f = import path; - in f ((builtins.intersectAttrs (builtins.functionArgs f) commonArgs) + make = path: overrides: let + f = import path; + in + f ((builtins.intersectAttrs (builtins.functionArgs f) commonArgs) // overrides); - cvTEX = builtins.toFile "cv.tex" (make ./src { }); - source = pkgs.callPackage ({ noto-fonts-emoji, + cvTEX = builtins.toFile "cv.tex" (make ./src {}); + source = pkgs.callPackage ({ + noto-fonts-emoji, # Source files - cv-tex ? cvTEX, files ? data.files }: - pkgs.runCommand "cv-src" { } '' + cv-tex ? cvTEX, + files ? data.files, + }: + pkgs.runCommand "cv-src" {} '' mkdir -p "$out" && cd $_ ln -sT ${cv-tex} cv.tex ln -sT ${files} files ln -sT ${noto-fonts-emoji}/share/fonts/noto fonts - '') { }; + '') {}; + + latexDeps = tl: { + inherit + (tl) + scheme-basic + biber + biblatex + latexmk + luatex + luatexbase + moderncv + fontspec + fontawesome5 + academicons + pgf + multirow + arydshln + emoji + ; + }; in { + inherit latexDeps; + src = source; - pdf = pkgs.callPackage ({ cv-src ? source, texlive }: + pdf = pkgs.callPackage ({ + cv-src ? source, + texlive, + }: pkgs.runCommand "cv.pdf" { - buildInputs = [ texlive.combined.moderncv ]; + buildInputs = [(texlive.combine (latexDeps texlive))]; } '' export HOME=$(pwd) latexmk -pdflua -cd "${cv-src}"/cv.tex --output-directory=$(pwd) mv cv.pdf "$out" - '') { }; + '') {}; } -- cgit v1.2.3