2022-12-10 04:58:09 +00:00
|
|
|
{
|
|
|
|
description = "Resume";
|
|
|
|
|
|
|
|
inputs = {
|
2024-04-25 02:59:22 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2022-12-10 04:58:09 +00:00
|
|
|
};
|
|
|
|
|
2024-04-26 00:26:46 +00:00
|
|
|
nixConfig = {
|
|
|
|
extra-trusted-public-keys = "alejandr0angul0-resume.cachix.org-1:tLOx+VCWz+yMyONGbgPnhQ3F3E4GylO8QAFxoCwnC34=";
|
|
|
|
extra-substituters = "https://alejandr0angul0-resume.cachix.org";
|
|
|
|
};
|
|
|
|
|
2022-12-10 04:58:09 +00:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2023-02-12 18:01:09 +00:00
|
|
|
}: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
lib = pkgs.lib;
|
|
|
|
system = "x86_64-linux";
|
|
|
|
nerdfonts-hack = pkgs.nerdfonts.override {
|
|
|
|
fonts = ["Hack"];
|
|
|
|
};
|
|
|
|
tex = pkgs.texlive.combine {
|
2024-04-25 02:59:22 +00:00
|
|
|
inherit (pkgs.texlive) scheme-basic latex-bin latexmk enumitem multirow titlesec xcolor fontspec chktex latexindent etoolbox;
|
2023-02-12 18:01:09 +00:00
|
|
|
};
|
|
|
|
vars = ["email" "phonenumber"];
|
|
|
|
# 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)
|
2023-02-12 19:05:57 +00:00
|
|
|
texvars = toString (lib.concatMapStrings (x: ''\\def\\${x}{${"$" + lib.toUpper x}}'') vars);
|
2023-02-12 18:01:09 +00:00
|
|
|
in {
|
|
|
|
packages.${system} = {
|
|
|
|
# inherit system;
|
|
|
|
alejandro-resume = pkgs.stdenvNoCC.mkDerivation rec {
|
|
|
|
name = "alejandro-resume";
|
|
|
|
src = self;
|
|
|
|
propogatedBuildInputs = [pkgs.coreutils nerdfonts-hack tex];
|
|
|
|
phases = ["unpackPhase" "buildPhase" "installPhase"];
|
|
|
|
buildPhase = ''
|
2023-02-12 19:05:57 +00:00
|
|
|
cp build.sh alejandro-resume
|
|
|
|
sed -i 's!PREFIX=""!PREFIX="${builtins.placeholder "out"}"!g' alejandro-resume
|
|
|
|
sed -i 's!PATH=""!PATH="${lib.makeBinPath propogatedBuildInputs}"!g' alejandro-resume
|
|
|
|
sed -i 's!TEXVARS=""!TEXVARS="${texvars}"!g' alejandro-resume
|
|
|
|
sed -i 's!NERDFONTS=""!NERDFONTS="${nerdfonts-hack}"!g' alejandro-resume
|
2023-02-12 18:01:09 +00:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,share}
|
|
|
|
cp alejandro_resume.tex $out/share/alejandro_resume.tex
|
|
|
|
cp alejandro-resume $out/bin/alejandro-resume
|
|
|
|
chmod u+x $out/bin/alejandro-resume
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
default = self.packages.${system}.alejandro-resume;
|
|
|
|
};
|
2022-12-10 04:58:09 +00:00
|
|
|
|
2023-02-12 18:01:09 +00:00
|
|
|
devShells.${system} = {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
name = "default";
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
alejandra
|
|
|
|
direnv
|
|
|
|
git
|
|
|
|
pre-commit
|
|
|
|
tex #TODO: Is this necessary?
|
|
|
|
zathura # PDF Viewer
|
2023-02-12 19:05:57 +00:00
|
|
|
shellcheck
|
2023-02-12 18:01:09 +00:00
|
|
|
];
|
2022-12-10 04:58:09 +00:00
|
|
|
|
2023-02-12 18:01:09 +00:00
|
|
|
shellHook = ''
|
|
|
|
PATH=${pkgs.writeShellScriptBin "nix" ''
|
|
|
|
${pkgs.nixVersions.stable}/bin/nix --experimental-features "nix-command flakes" "$@"
|
|
|
|
''}/bin:$PATH
|
2022-12-10 04:58:09 +00:00
|
|
|
|
2023-02-12 18:01:09 +00:00
|
|
|
if [ ! -f ".git/hooks/pre-commit" ]; then
|
|
|
|
pre-commit install &> /dev/null
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-12-10 04:58:09 +00:00
|
|
|
}
|