summaryrefslogtreecommitdiff
path: root/publications
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2023-09-17 18:40:48 +0200
committerquentin@aristote.fr <quentin@aristote.fr>2023-09-17 18:40:48 +0200
commiteebffc190776afdb92ef959270c4863bf21a3cf8 (patch)
tree68c7bd8fa25b9044213b67c34adba822445c65f2 /publications
parent7f5f01ef3d3eb56a24db31b7ddf85fc4ce3b37fc (diff)
reformat code
Diffstat (limited to 'publications')
-rw-r--r--publications/default.nix57
1 files changed, 29 insertions, 28 deletions
diff --git a/publications/default.nix b/publications/default.nix
index 2c85dff..4c7189f 100644
--- a/publications/default.nix
+++ b/publications/default.nix
@@ -1,29 +1,30 @@
-{ pkgs, lib, ... }:
-
-let
+{
+ pkgs,
+ lib,
+ ...
+}: let
csl = lib.importJSON ./publications.json;
- 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;
- tryInherit = inheritFrom: attrs:
- with lib;
- foldl' (tmp: next:
- tmp ++ optional (hasAttr next inheritFrom) (getAttr next inheritFrom)) [ ]
- attrs;
-in builtins.map (publication:
- with publication;
- let exportThisTo = export id publication;
- in publication // {
- year = with builtins; toString (head (head issued.date-parts));
- url = URL;
- cite = {
- bibtex = exportThisTo "bibtex";
- biblatex = exportThisTo "biblatex";
- csljson = exportThisTo "csljson";
- };
- }) csl
+ 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;
+in
+ builtins.map (publication:
+ with publication; let
+ exportThisTo = export id publication;
+ in
+ publication
+ // {
+ year = with builtins; toString (head (head issued.date-parts));
+ url = URL;
+ cite = {
+ bibtex = exportThisTo "bibtex";
+ biblatex = exportThisTo "biblatex";
+ csljson = exportThisTo "csljson";
+ };
+ })
+ csl