summaryrefslogtreecommitdiff
path: root/publications/default.nix
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2025-02-16 20:59:22 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2025-02-16 21:42:10 +0100
commit700aae6e4ae56034d105eab95be5fcb969b3853a (patch)
treec95e1a663a6d472c2936b5f4c771d3399edd2545 /publications/default.nix
parent62e4fd8bd3e86bbf32e6ef64811c055958c4e1e5 (diff)
publications: export inside a package
Diffstat (limited to 'publications/default.nix')
-rw-r--r--publications/default.nix18
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 {};
}