feat: better way to pass git rev
This commit is contained in:
parent
da7939855b
commit
c937821c11
5 changed files with 7 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
result*
|
result*
|
||||||
|
*.pdf
|
||||||
|
|
1
.rev
1
.rev
|
@ -1 +0,0 @@
|
||||||
UNSTABLE_DO_NOT_USE
|
|
BIN
cv.pdf
BIN
cv.pdf
Binary file not shown.
16
flake.nix
16
flake.nix
|
@ -54,11 +54,11 @@
|
||||||
dest = "icons";
|
dest = "icons";
|
||||||
src = "${inputs.font-awesome}/svgs/regular";
|
src = "${inputs.font-awesome}/svgs/regular";
|
||||||
}
|
}
|
||||||
{
|
|
||||||
src = ./.rev;
|
|
||||||
dest = ".rev";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
typstOpts = {
|
||||||
|
input = ''GIT_REV=${if (self ? rev) then self.rev else "GIT_UNSTABLE_DONT_USE"}'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
typstPackagesSrc = "${inputs.typst-packages}/packages";
|
typstPackagesSrc = "${inputs.typst-packages}/packages";
|
||||||
|
@ -83,14 +83,6 @@
|
||||||
XDG_CACHE_HOME = typstPackagesCache;
|
XDG_CACHE_HOME = typstPackagesCache;
|
||||||
|
|
||||||
SOURCE_DATE_EPOCH = builtins.toString self.lastModified;
|
SOURCE_DATE_EPOCH = builtins.toString self.lastModified;
|
||||||
|
|
||||||
preBuild =
|
|
||||||
if (self ? rev) then
|
|
||||||
''
|
|
||||||
echo ${self.rev} >> .rev
|
|
||||||
''
|
|
||||||
else
|
|
||||||
"";
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import "@preview/fontawesome:0.5.0": *
|
#import "@preview/fontawesome:0.5.0": *
|
||||||
|
|
||||||
#let git_rev = read("./.rev", encoding: "utf8")
|
#let git_rev = sys.inputs.GIT_REV;
|
||||||
|
|
||||||
#let _cv-line(left, right, ..args) = {
|
#let _cv-line(left, right, ..args) = {
|
||||||
set block(below: 0pt)
|
set block(below: 0pt)
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
#name\
|
#name\
|
||||||
#datetime.today().display("[month repr:long] [day], [year]")
|
#datetime.today().display("[month repr:long] [day], [year]")
|
||||||
|
|
||||||
#text(size: 8pt)[Built from revision #git_rev]
|
#text(size: 8pt)[Built from revision #git_rev.]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue