summaryrefslogtreecommitdiff
path: root/src/languages/default.nix
blob: 067ba839fe9ff799cb756ffae364841bf45b8251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  latex,
  data,
  lib,
  ...
}:
let
  sortByProficiency = lib.sort (
    lang1: lang2:
    let
      prof1 = lang1.proficiency;
      prof2 = lang2.proficiency;
    in
    (prof2 == "basic") || (prof1 == "native") || (prof2 == "intermediate" && prof1 == "fluent")
  );
in
{
  title = "Languages";
  priority = 20;
  extraHeader = ''
    \usepackage{emoji}
    \setemojifont{NotoColorEmoji.ttf}[Path=./fonts/]
    \usepackage{multicol}
  '';
  content =
    with latex;
    environmentWithOpts "multicols" [ "2" ] (
      for (sortByProficiency data.languages) (
        lang: with lang; moderncv.cvline "${name} \\emoji{${icon.shortcode}}" proficiency
      )
    );
}