From 984c9ba0a781d76703794e226c38b083bc1f9b1c Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Sat, 10 Dec 2022 08:32:16 -0800 Subject: [PATCH] Enabled used of envvars to set placeholder values --- flake.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 94101a5..d1a04db 100644 --- a/flake.nix +++ b/flake.nix @@ -20,11 +20,10 @@ inherit (pkgs.texlive) scheme-full latex-bin latexmk; }; vars = ["email" "phonenumber"]; - # Create definitions like \def\email{1} - # Each variable will be set to the command line argument at the - # variable's position (first arg passed to resume generator will fill - # in usages of \email in the tex flie) - texvars = toString (pkgs.lib.imap1 (i: n: ''\def\${n}{${"$" + (toString i)}}'') vars); + # Create definitions like \def\email{$EMAIL} + # Each \email command in the tex document will be populated by an EMAIL + # variable (can be set as an environment variable) + texvars = toString (pkgs.lib.concatMapStrings (x: ''\def\${x}{${"$" + pkgs.lib.toUpper x}}'') vars); in rec { packages = { alejandro-resume = pkgs.stdenvNoCC.mkDerivation rec {