resume/flake.nix

88 lines
2.1 KiB
Nix
Raw Normal View History

2024-05-05 22:04:20 -04:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
};
outputs = {
2024-05-05 23:03:34 -04:00
self,
2024-05-05 22:04:20 -04:00
systems,
nixpkgs,
...
} @ inputs: let
eachSystem = f:
nixpkgs.lib.genAttrs (import systems) (
system:
f nixpkgs.legacyPackages.${system}
);
in {
2024-05-05 23:03:34 -04:00
packages = eachSystem (pkgs: {
default = pkgs.stdenvNoCC.mkDerivation rec {
name = "resume-latex";
src = self;
2024-10-25 05:46:59 +00:00
buildInputs = with pkgs;[
2024-05-05 23:03:34 -04:00
pkgs.coreutils
pkgs.findutils
2024-10-25 05:46:59 +00:00
(texlive.combine {
2024-10-25 05:46:02 +00:00
inherit
(texlive)
scheme-small
academicons
arydshln
fontawesome5
marvosym
moderncv
multirow
;
})
2024-05-05 23:03:34 -04:00
];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}"
echo $PATH
mkdir -p .cache/texmf-var
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -interaction=nonstopmode -f -pdf \
resume.tex
'';
installPhase = ''
mkdir -p $out
cp resume.pdf $out/
'';
};
2024-10-18 23:54:34 -04:00
pdf = pkgs.runCommand "resume-pdf" {} ''
mkdir -p $out/nix-support
cp ${self.packages.${pkgs.system}.default}/resume.pdf $out/
echo "file pdf $out/resume.pdf" > $out/nix-support/hydra-build-products
'';
2024-05-05 23:03:34 -04:00
});
2024-10-18 23:51:19 -04:00
hydraJobs = let
system = "x86_64-linux";
in {
build = self.packages.${system}.default;
2024-10-18 23:54:34 -04:00
pdf = self.packages.${system}.pdf;
2024-10-18 23:44:04 -04:00
};
2024-10-18 23:35:39 -04:00
2024-05-05 22:04:20 -04:00
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
2024-10-25 05:46:59 +00:00
buildInputs = with pkgs; [
(texlive.combine {
2024-10-25 05:46:02 +00:00
inherit
(texlive)
scheme-small
academicons
arydshln
fontawesome5
marvosym
moderncv
multirow
;
})
2024-05-05 22:04:20 -04:00
pkgs.texlab
pkgs.termpdfpy
];
};
});
};
}