summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/default.nix49
-rw-r--r--src/education/default.nix31
-rw-r--r--src/experience/default.nix27
-rw-r--r--src/languages/default.nix22
-rw-r--r--src/publications/default.nix10
-rw-r--r--src/sections.nix28
6 files changed, 100 insertions, 67 deletions
diff --git a/src/default.nix b/src/default.nix
index 421367b..e698a93 100644
--- a/src/default.nix
+++ b/src/default.nix
@@ -1,22 +1,27 @@
-{ latex, data, make, ... }:
-
-with latex;
-let sections = sort.byKey "priority" (make ./sections.nix { });
-in with data.basics;
-lines [
- (builtins.readFile ./header.tex)
- (comment "-------------------- EXTRA --------------------")
- (for sections (section: section.extraHeader))
- (comment "-------------------- DATA --------------------")
- (moderncv.name name.first name.last)
- (moderncv.email email.personal)
- (moderncv.extrainfo (latex.url url))
- (moderncv.photo { "" = "128pt"; } avatar)
- ""
- (document [
- (title institution.position)
- moderncv.makecvtitle
- description
- (for sections (section: section.content))
- ])
-]
+{
+ latex,
+ data,
+ make,
+ ...
+}:
+with latex; let
+ sections = sort.byKey "priority" (make ./sections.nix {});
+in
+ with data.basics;
+ lines [
+ (builtins.readFile ./header.tex)
+ (comment "-------------------- EXTRA --------------------")
+ (for sections (section: section.extraHeader))
+ (comment "-------------------- DATA --------------------")
+ (moderncv.name name.first name.last)
+ (moderncv.email email.personal)
+ (moderncv.extrainfo (latex.url url))
+ (moderncv.photo {"" = "128pt";} avatar)
+ ""
+ (document [
+ (title institution.position)
+ moderncv.makecvtitle
+ description
+ (for sections (section: section.content))
+ ])
+ ]
diff --git a/src/education/default.nix b/src/education/default.nix
index 5b79323..2d46730 100644
--- a/src/education/default.nix
+++ b/src/education/default.nix
@@ -1,8 +1,12 @@
-{ latex, data, lib, ... }:
-
-let
+{
+ latex,
+ data,
+ lib,
+ ...
+}: let
education = data.education;
- sortByStartDate = latex.sort.reverse.byFun
+ sortByStartDate =
+ latex.sort.reverse.byFun
(x: with x.date.start; day + 100 * month + 10000 * year);
in {
title = "Education";
@@ -10,12 +14,15 @@ in {
content = with latex;
for (sortByStartDate education) (item:
with item;
- [
- (moderncv.cventry (latex.timerange date.start date.end) studyType
- (with institution; href url name) institution.location "" description)
- ] ++ lib.optional (item ? "years") (for (sortByStartDate years) (year:
- with year;
- moderncv.cvlistitem "${with program; bold (href url acronym)} (${
- timerange date.start date.end
- }). ${program.studyType}. {\\small ${description}}")));
+ [
+ (moderncv.cventry (latex.timerange date.start date.end) studyType
+ (with institution; href url name)
+ institution.location ""
+ description)
+ ]
+ ++ lib.optional (item ? "years") (for (sortByStartDate years) (year:
+ with year;
+ moderncv.cvlistitem "${with program; bold (href url acronym)} (${
+ timerange date.start date.end
+ }). ${program.studyType}. {\\small ${description}}")));
}
diff --git a/src/experience/default.nix b/src/experience/default.nix
index 500fd9e..a095d3d 100644
--- a/src/experience/default.nix
+++ b/src/experience/default.nix
@@ -1,6 +1,10 @@
-{ latex, data, lib, ... }:
-
-let experience = data.experience;
+{
+ latex,
+ data,
+ lib,
+ ...
+}: let
+ experience = data.experience;
in {
title = "Experience";
priority = 0;
@@ -8,14 +12,19 @@ in {
for
(sort.reverse.byFun (x: with x.date.start; day + 100 * month + 10000 * year)
experience) (item:
- with item;
+ with item;
moderncv.cventry (latex.timerange date.start date.end)
institution.position (with institution; href url name)
- institution.location (if item ? supervisors then
- "supervised by " + lib.concatStringsSep " \\& "
- (for supervisors (supervisor: with supervisor; href url name))
- else
- "") (description + lib.optionalString (item ? assets) (" " + cite
+ institution.location (
+ if item ? supervisors
+ then
+ "supervised by "
+ + lib.concatStringsSep " \\& "
+ (for supervisors (supervisor: with supervisor; href url name))
+ else ""
+ ) (description
+ + lib.optionalString (item ? assets) (" "
+ + cite
(lib.concatStringsSep ","
(for (lib.filter (asset: asset.type == "Publications") assets)
(lib.getAttr "id"))))));
diff --git a/src/languages/default.nix b/src/languages/default.nix
index d030818..9853c32 100644
--- a/src/languages/default.nix
+++ b/src/languages/default.nix
@@ -1,12 +1,16 @@
-{ latex, data, lib, ... }:
-
-let
+{
+ latex,
+ data,
+ lib,
+ ...
+}: let
languages = data.languages;
- sortByProficiency = lib.sort (lang1: lang2:
- let
- prof1 = lang1.proficiency;
- prof2 = lang2.proficiency;
- in (prof2 == "basic") || (prof1 == "native")
+ sortByProficiency = lib.sort (lang1: lang2: let
+ prof1 = lang1.proficiency;
+ prof2 = lang2.proficiency;
+ in
+ (prof2 == "basic")
+ || (prof1 == "native")
|| (prof2 == "intermediate" && prof1 == "fluent"));
in {
title = "Languages";
@@ -18,5 +22,5 @@ in {
content = with latex;
for (sortByProficiency languages) (lang:
with lang;
- moderncv.cvline "${name} \\emoji{${icon.shortcode}}" proficiency);
+ moderncv.cvline "${name} \\emoji{${icon.shortcode}}" proficiency);
}
diff --git a/src/publications/default.nix b/src/publications/default.nix
index 1d6232e..bc081c7 100644
--- a/src/publications/default.nix
+++ b/src/publications/default.nix
@@ -1,10 +1,12 @@
-{ latex, data, lib, ... }:
-
-let
+{
+ latex,
+ data,
+ ...
+}: let
publications = data.publications;
publicationsBIB = builtins.toFile "publications.bib" (latex.lines
(builtins.map (entry: entry.cite.biblatex)
- (latex.sort.reverse.byPath [ "issued" "date-parts" ] publications)));
+ (latex.sort.reverse.byPath ["issued" "date-parts"] publications)));
in {
title = "Publications";
priority = 30;
diff --git a/src/sections.nix b/src/sections.nix
index faed484..2778beb 100644
--- a/src/sections.nix
+++ b/src/sections.nix
@@ -1,15 +1,21 @@
-{ latex, make, ... }:
-
-let
+{
+ latex,
+ make,
+ ...
+}: let
sectionTemplate = section: {
inherit (section) title priority;
- extraHeader = if section ? extraHeader then section.extraHeader else "";
+ extraHeader =
+ if section ? extraHeader
+ then section.extraHeader
+ else "";
content = latex.section section.title section.content;
};
- makeSection = path: sectionTemplate (make path { });
-in builtins.map makeSection [
- ./experience
- ./education
- ./languages
- ./publications
-]
+ makeSection = path: sectionTemplate (make path {});
+in
+ builtins.map makeSection [
+ ./experience
+ ./education
+ ./languages
+ ./publications
+ ]