From 700aae6e4ae56034d105eab95be5fcb969b3853a Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Sun, 16 Feb 2025 20:59:22 +0100 Subject: publications: export inside a package --- publications/default.nix | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'publications/default.nix') diff --git a/publications/default.nix b/publications/default.nix index 0c13869..d41555c 100644 --- a/publications/default.nix +++ b/publications/default.nix @@ -3,29 +3,15 @@ lib, ... }: let - export = id: publication: format: let - publicationJSON = - builtins.toFile "${id}.json" (builtins.toJSON [publication]); - publicationOut = pkgs.runCommand "${id}.${format}" {} '' - "${pkgs.pandoc}/bin/pandoc" "${publicationJSON}" --from csljson --to "${format}" --output "$out" - ''; - in - builtins.readFile publicationOut; importPublications = builtins.map (publication: - with publication; let - exportThisTo = export id publication; - in + with publication; publication // { year = with builtins; toString (head (head issued.date-parts)); url = URL; - cite = { - bibtex = exportThisTo "bibtex"; - biblatex = exportThisTo "biblatex"; - csljson = exportThisTo "csljson"; - }; }); in { selected = importPublications (lib.importJSON ./publications_selected.json); all = importPublications (lib.importJSON ./publications.json); + files = pkgs.callPackage ./export.nix {}; } -- cgit v1.2.3