diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2025-02-16 20:59:22 +0100 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2025-02-16 21:42:10 +0100 |
| commit | 700aae6e4ae56034d105eab95be5fcb969b3853a (patch) | |
| tree | c95e1a663a6d472c2936b5f4c771d3399edd2545 /publications/default.nix | |
| parent | 62e4fd8bd3e86bbf32e6ef64811c055958c4e1e5 (diff) | |
publications: export inside a package
Diffstat (limited to 'publications/default.nix')
| -rw-r--r-- | publications/default.nix | 18 |
1 files changed, 2 insertions, 16 deletions
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 {}; } |
