Skip to content

Commit

Permalink
Use Flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
gapuchi committed May 28, 2024
1 parent fd3cfdc commit 3901586
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 291 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -16,11 +13,6 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v2

- name: Generate Latex Doc
run: |
cargo install jsonresume-renderer
$HOME/.cargo/bin/jsonresume-renderer -j $GITHUB_WORKSPACE/config/resume.json -t $GITHUB_WORKSPACE/templates/resume.tex -o resume.tex
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
Expand All @@ -36,16 +28,6 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Resume LaTex
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./resume.tex
asset_name: resume.tex
asset_content_type: application/text

- name: Upload Resume PDF
uses: actions/upload-release-asset@v1
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/website.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/
*.iml
/resume.*
.envrc
.direnv
result
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
# Resume

This repo generates my resume, using [JSON Resume standard](https://jsonresume.org/). It does two things:

1. Generates a PDF.
1. Updates my resume website.

## PDF Generation

A workflow uses the [jsonresume-renderer](https://github.com/gapuchi/jsonresume-renderer). The JSON resume file and LaTex template file present in this repo are passed to the `jsonresume-renderer` binary, which generates a LaTex file. [github-action-for-latex](https://github.com/marketplace/actions/github-action-for-latex) compiles the generated latex file to a PDF. Both the LaTex and PDF files are uploaded as assets to this repo's releases.
This repo generates my resume. [github-action-for-latex](https://github.com/marketplace/actions/github-action-for-latex) compiles the generated latex file to a PDF. It is then uploaded as an asset to this repo's releases.

Check out the [Releases](https://github.com/gapuchi/resume/releases) for my latest resume.

## Website

A workflow pushes my `resume.json` to a public Github Gist, which is then rendered by [JSON Resume](https://jsonresume.org/getting-started/).

Check out my [resume website](https://registry.jsonresume.org/gapuchi).
149 changes: 0 additions & 149 deletions config/resume.json

This file was deleted.

27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
description = "LaTex Build";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};

outputs = { self, nixpkgs }: {
devShells.x86_64-linux.default =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in pkgs.mkShell {
buildInputs = with pkgs; [
texliveFull
];
};

packages.x86_64-linux.default =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in pkgs.stdenvNoCC.mkDerivation rec {
name = "hello";
src = self;
buildInputs = with pkgs; [
pkgs.coreutils
pkgs.texliveFull
];
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -interaction=nonstopmode -pdf document.tex
'';
installPhase = ''
mkdir -p $out
cp document.pdf $out/
'';
};
};
}
Loading

0 comments on commit 3901586

Please sign in to comment.