From d9e6ea7a82e0239edc6884b7a759a2c5607e8dbc Mon Sep 17 00:00:00 2001 From: Matt Schreiber Date: Sun, 20 Nov 2022 09:40:46 -0500 Subject: [PATCH 1/2] fix(nix): match current flake output schema by adding `packages..default` and `devShells..default`, which are used in the current flake output schema in place of, respectively, `defaultPackage.` and `devShell.`. Retain `defaultPackage.` and `devShell.` for compatibility with older Nix clients, but make them aliases for the newer output schema attributes. --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index ed1d8665..2469dc3a 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,8 @@ in { packages = perSystem (system: let - resume = buildResumeFor system; + pkgs = pkgsFor system; + resume = pkgs.pandocResume.buildResume { inDir = "${self}/markdown"; }; in { inherit resume; From 5b1f38367ddf7cac90e85b29ebf936278028cd57 Mon Sep 17 00:00:00 2001 From: Matt Schreiber Date: Sun, 20 Nov 2022 09:55:40 -0500 Subject: [PATCH 2/2] feat(nix): expose `buildResume` function via a new `overlays` output. This function is used for building resumes stored in arbitrary locations. --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 45 +++++++++++++++++++++++++++-------- 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d5806a21..f4cfdf8d 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,76 @@ nix build The built resume will end up in `./result`. +Additionally, this project's flake overlay output exposes the function +`pandocResume.buildResume` for building a resume stored somewhere other than +[the default location](#instructions): + +```nix +{ + description = "Flake for building my resume"; + + inputs = { pandoc_resume.url = "github:mszep/pandoc_resume"; }; + + outputs = { self, nixpkgs, pandoc_resume }: + { + packages.x86_64-linux = + let + pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ pandoc_resume.overlays.pandocResume ]; }; + + myResume = pkgs.pandocResume.buildResume { + # Mandatory. + # + # Must specify a directory containing a resume whose basename + # includes the extension `.md`. + inDir = "${self}/my-resume"; + + # Optional. + # + # The specified directory must contain the files `