From e812fe39f3e53824ecb91fc5eef83c803bd7fdc9 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Fri, 13 Oct 2023 22:28:34 +0200 Subject: [PATCH] Flake --- .envrc | 1 + .gitignore | 2 + flake.lock | 61 +++++++++++++++++++ flake.nix | 41 +++++++++++++ basic-info.md => references/basic-info.md | 0 .../joost_reference.tex | 0 .../reference-thingy.cls | 0 cv.tex => src/cv.tex | 0 8 files changed, 105 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix rename basic-info.md => references/basic-info.md (100%) rename joost_reference.tex => references/joost_reference.tex (100%) rename reference-thingy.cls => references/reference-thingy.cls (100%) rename cv.tex => src/cv.tex (100%) diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..726d2d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1f9e80c --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1696983906, + "narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e571682 --- /dev/null +++ b/flake.nix @@ -0,0 +1,41 @@ +{ description = "Curriculum Vitae"; + inputs = { + nixpkgs.url = github:nixos/nixpkgs/nixos-23.05; + flake-utils.url = github:numtide/flake-utils; + }; + outputs = { self, nixpkgs, flake-utils}: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + input = "cv"; + in { + packages = rec { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + coreutils + texlive.combined.scheme-full + texlab + ]; + }; + document = pkgs.stdenvNoCC.mkDerivation rec { + pname = "Curriculum Vitae"; + version = "1.1"; + src = ./src; + buildInputs = with pkgs; [ + coreutils + texlive.combined.scheme-full + ]; + buildPhase = '' + mkdir -p .cache/texmf-var + env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \ + latexmk -interaction=nonstopmode -pdf -pdflatex \ + ${input}.tex + ''; + installPhase = '' + mkdir -p $out + cp ${input}.pdf $out/ + ''; + }; + default = document; + }; + }); +} diff --git a/basic-info.md b/references/basic-info.md similarity index 100% rename from basic-info.md rename to references/basic-info.md diff --git a/joost_reference.tex b/references/joost_reference.tex similarity index 100% rename from joost_reference.tex rename to references/joost_reference.tex diff --git a/reference-thingy.cls b/references/reference-thingy.cls similarity index 100% rename from reference-thingy.cls rename to references/reference-thingy.cls diff --git a/cv.tex b/src/cv.tex similarity index 100% rename from cv.tex rename to src/cv.tex