From d065ca364eb78cfeb43d3d10ff1fde7c04bb966d Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 20 Feb 2023 05:49:59 +0000 Subject: [PATCH] Build resume using nix derivation --- build/builder.sh | 1 + flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++---- flake.nix | 4 +++- lib.nix | 3 ++- 4 files changed, 62 insertions(+), 7 deletions(-) diff --git a/build/builder.sh b/build/builder.sh index b27e5c0..2613ccb 100644 --- a/build/builder.sh +++ b/build/builder.sh @@ -15,6 +15,7 @@ hugo $hugoFlags --config=config.toml,config-gen.toml # Can't do submodules because nix flake inputs get their .git deleted mkdir -p static/graph && ruby ./analyze.rb > static/graph/graph.gen.js # Graph files stork build --input public/index.toml --output static/index.st # Search index +cp $resume/Resume-Danila-Fedorin.pdf static/Resume-Danila-Fedorin.pdf # Static folder changed, re-run Hugo hugo $hugoFlags --config=config.toml,config-gen.toml diff --git a/flake.lock b/flake.lock index 8e9bce5..2b80323 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "blog-source": { "flake": false, "locked": { - "lastModified": 1672635175, - "narHash": "sha256-TBcchhkWjpGNVU5W1AWqYFOPzB2ejNsAqF8pM2vB4Ac=", + "lastModified": 1676848263, + "narHash": "sha256-OZY1eueOqibJck7IrFsc1flQ2mb6FRA6gEPkg0cUvhQ=", "ref": "master", - "rev": "5c62107e3bb0ef0f126d5d6adf532a7187884687", - "revCount": 619, + "rev": "d003fdf35751386fa69e5011febfcdb7a1629e15", + "revCount": 627, "submodules": true, "type": "git", "url": "https://dev.danilafe.com/Web-Projects/blog-static.git" @@ -63,6 +63,21 @@ "type": "github" } }, + "flake-utils_4": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "katex-html": { "inputs": { "flake-utils": "flake-utils_2", @@ -147,12 +162,48 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1676718858, + "narHash": "sha256-giQecvcifVLNHCC9lMfTGP09tNxXhOMw+d/aql7MhRw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e6d5772f3515b8518d50122471381feae7cbae36", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "resume": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1676871379, + "narHash": "sha256-b9QCL1/0/cpIgv5tXXZV+osOSDA3YVKbOuBJfq+JAUg=", + "ref": "master", + "rev": "984256a0faa5c44ec01f76864fbcb9420f129788", + "revCount": 43, + "type": "git", + "url": "https://dev.danilafe.com/DanilaFe/resume" + }, + "original": { + "type": "git", + "url": "https://dev.danilafe.com/DanilaFe/resume" + } + }, "root": { "inputs": { "blog-source": "blog-source", "flake-utils": "flake-utils", "katex-html": "katex-html", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_3", + "resume": "resume" } } }, diff --git a/flake.nix b/flake.nix index ea13de3..df037a5 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ nixpkgs.url = "github:nixos/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; katex-html.url = "git+https://dev.danilafe.com/Nix-Configs/katex-html"; + resume.url = "git+https://dev.danilafe.com/DanilaFe/resume"; blog-source = { flake = false; url = "https://dev.danilafe.com/Web-Projects/blog-static.git"; @@ -11,12 +12,13 @@ }; }; - outputs = { self, blog-source, nixpkgs, flake-utils, katex-html }: + outputs = { self, blog-source, nixpkgs, flake-utils, katex-html, resume }: let buildersFor = system: import ./lib.nix { inherit blog-source; pkgs = import nixpkgs { inherit system; }; katex-html = katex-html.defaultPackage.${system}; + resume = resume.defaultPackage.${system}; }; in { diff --git a/lib.nix b/lib.nix index 418f9ee..6e88a9b 100644 --- a/lib.nix +++ b/lib.nix @@ -1,4 +1,4 @@ -{ blog-source, pkgs, katex-html }: +{ blog-source, pkgs, katex-html, resume }: with pkgs; with lib; @@ -7,6 +7,7 @@ let protocol = ssl: if ssl then "https://" else "http://"; website = settings: stdenv.mkDerivation { inherit (settings) src ssl host; + inherit resume; name = "blog-static"; version = settings.src.rev or "dirty"; publicPath = settings.path;