fix: get time and git revision from nix typst environment
This commit is contained in:
parent
8a64ae158c
commit
da7939855b
5 changed files with 33 additions and 8 deletions
1
.rev
Normal file
1
.rev
Normal file
|
@ -0,0 +1 @@
|
|||
UNSTABLE_DO_NOT_USE
|
BIN
cv.pdf
BIN
cv.pdf
Binary file not shown.
4
cv.typ
4
cv.typ
|
@ -76,10 +76,6 @@
|
|||
Nix and NixOS, Docker and NixOS based service deployment and system administration.
|
||||
]
|
||||
|
||||
#cv-line[Other][
|
||||
Git and Mercurial Version Control.
|
||||
]
|
||||
|
||||
= Papers
|
||||
|
||||
== Preprints
|
||||
|
|
32
flake.nix
32
flake.nix
|
@ -54,11 +54,11 @@
|
|||
dest = "icons";
|
||||
src = "${inputs.font-awesome}/svgs/regular";
|
||||
}
|
||||
{
|
||||
src = ./.rev;
|
||||
dest = ".rev";
|
||||
}
|
||||
];
|
||||
|
||||
XDG_CACHE_HOME = typstPackagesCache;
|
||||
|
||||
SOURCE_DATE_EPOCH = builtins.toString self.lastModified;
|
||||
};
|
||||
|
||||
typstPackagesSrc = "${inputs.typst-packages}/packages";
|
||||
|
@ -79,6 +79,18 @@
|
|||
commonArgs
|
||||
// {
|
||||
inherit src;
|
||||
|
||||
XDG_CACHE_HOME = typstPackagesCache;
|
||||
|
||||
SOURCE_DATE_EPOCH = builtins.toString self.lastModified;
|
||||
|
||||
preBuild =
|
||||
if (self ? rev) then
|
||||
''
|
||||
echo ${self.rev} >> .rev
|
||||
''
|
||||
else
|
||||
"";
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -88,6 +100,18 @@
|
|||
commonArgs
|
||||
// {
|
||||
inherit src;
|
||||
|
||||
XDG_CACHE_HOME = typstPackagesCache;
|
||||
|
||||
SOURCE_DATE_EPOCH = builtins.toString self.lastModified;
|
||||
|
||||
preBuild =
|
||||
if (self ? rev) then
|
||||
''
|
||||
echo ${self.rev} >> .rev
|
||||
''
|
||||
else
|
||||
"";
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#import "@preview/fontawesome:0.5.0": *
|
||||
|
||||
#let git_rev = read("./.rev", encoding: "utf8")
|
||||
|
||||
#let _cv-line(left, right, ..args) = {
|
||||
set block(below: 0pt)
|
||||
table(
|
||||
|
@ -144,6 +146,8 @@
|
|||
#v(1fr, weak: false)
|
||||
#name\
|
||||
#datetime.today().display("[month repr:long] [day], [year]")
|
||||
|
||||
#text(size: 8pt)[Built from revision #git_rev]
|
||||
]
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue