-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
56 lines (51 loc) · 1.8 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Nick's Resume :)";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-23.11";
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, gitignore }:
let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
drv = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
};
buildInputs = [ pkgs.coreutils tex ];
lastUpdatedDate = "2024-09-06";
in
pkgs.stdenvNoCC.mkDerivation {
name = "resume";
src = gitignore.lib.gitignoreSource ./.;
inherit buildInputs;
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
# NOTE this variable is used as the current timestamp by TeX
# It is used to print the last updated date in the document's footer
export SOURCE_DATE_EPOCH="$(date -d ${lastUpdatedDate} +%s)";
mkdir -p .cache/texmf-var
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -interaction=nonstopmode -pdf -lualatex \
resume.tex
'';
installPhase = ''
mkdir -p $out/dist/
cp resume.pdf $out/dist/
'';
}
);
in
{
packages = forAllSystems (system: {
default = drv.${system};
resume = drv.${system};
});
};
}