diff --git a/.gitignore b/.gitignore index fcfc4a1..34b3328 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ result* +*.pdf diff --git a/.rev b/.rev deleted file mode 100644 index 0254acb..0000000 --- a/.rev +++ /dev/null @@ -1 +0,0 @@ -UNSTABLE_DO_NOT_USE diff --git a/cv.pdf b/cv.pdf deleted file mode 100644 index a253e4a..0000000 Binary files a/cv.pdf and /dev/null differ diff --git a/flake.nix b/flake.nix index 5df18c4..c7e2623 100644 --- a/flake.nix +++ b/flake.nix @@ -54,11 +54,11 @@ dest = "icons"; 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"; @@ -83,14 +83,6 @@ XDG_CACHE_HOME = typstPackagesCache; SOURCE_DATE_EPOCH = builtins.toString self.lastModified; - - preBuild = - if (self ? rev) then - '' - echo ${self.rev} >> .rev - '' - else - ""; } ); diff --git a/template.typ b/template.typ index 4e99d4e..eb2a70f 100644 --- a/template.typ +++ b/template.typ @@ -1,6 +1,6 @@ #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) = { set block(below: 0pt) @@ -147,7 +147,7 @@ #name\ #datetime.today().display("[month repr:long] [day], [year]") - #text(size: 8pt)[Built from revision #git_rev] + #text(size: 8pt)[Built from revision #git_rev.] ] ]