about summary refs log tree commit diff
path: root/web/tvl
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-01-30T16·06+0300
committertazjin <tazjin@tvl.su>2022-01-31T16·11+0000
commitaa122cbae78ce97d60c0c98ba14df753d97e40b1 (patch)
tree12b98d85c4b18fe870feb26de70db9ba61837bd7 /web/tvl
parent2d10d60fac0fd00a71b65cfdcb9fba0477b2086c (diff)
style: format entire depot with nixpkgs-fmt r/3723
This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'web/tvl')
-rw-r--r--web/tvl/blog/default.nix2
-rw-r--r--web/tvl/default.nix10
-rw-r--r--web/tvl/footer/default.nix2
-rw-r--r--web/tvl/logo/default.nix42
-rw-r--r--web/tvl/template/default.nix16
5 files changed, 40 insertions, 32 deletions
diff --git a/web/tvl/blog/default.nix b/web/tvl/blog/default.nix
index fe8d1c42d6dd..963bb635e3b9 100644
--- a/web/tvl/blog/default.nix
+++ b/web/tvl/blog/default.nix
@@ -3,7 +3,7 @@
 {
   config = {
     name = "TVL's blog";
-    footer = depot.web.tvl.footer {};
+    footer = depot.web.tvl.footer { };
     baseUrl = "https://tvl.fyi/blog";
   };
 
diff --git a/web/tvl/default.nix b/web/tvl/default.nix
index 1025b1a7b2b4..262be54c0ef1 100644
--- a/web/tvl/default.nix
+++ b/web/tvl/default.nix
@@ -16,9 +16,10 @@ let
       (map (p: "cp ${blog.renderPost tvl.blog.config p} $out/blog/${p.key}.html") posts)
   );
 
-  tvlGraph = runCommandNoCC "tvl.svg" {
-    nativeBuildInputs = with pkgs; [ fontconfig freetype cairo jetbrains-mono ];
-  } ''
+  tvlGraph = runCommandNoCC "tvl.svg"
+    {
+      nativeBuildInputs = with pkgs; [ fontconfig freetype cairo jetbrains-mono ];
+    } ''
     ${graphviz}/bin/neato -Tsvg ${./tvl.dot} > $out
   '';
 
@@ -121,7 +122,8 @@ let
       </style>
     '';
   };
-in runCommandNoCC "website" {} ''
+in
+runCommandNoCC "website" { } ''
   mkdir -p $out/blog
   cp ${homepage} $out/index.html
   ${postRenderingCommands tvl.blog.posts}
diff --git a/web/tvl/footer/default.nix b/web/tvl/footer/default.nix
index 7412d019ee56..dc2c963f90f4 100644
--- a/web/tvl/footer/default.nix
+++ b/web/tvl/footer/default.nix
@@ -15,7 +15,7 @@ args: ''
     <a class="uncoloured-link" href="https://todo.tvl.fyi/">todos</a>
     |
     <a class="uncoloured-link" href="https://atward.tvl.fyi/">search</a>
-    '' + lib.optionalString (args ? extraFooter) args.extraFooter + ''
+'' + lib.optionalString (args ? extraFooter) args.extraFooter + ''
   </p>
   <p class="lod">ಠ_ಠ</p>
 ''
diff --git a/web/tvl/logo/default.nix b/web/tvl/logo/default.nix
index 940f67199bf6..d9e023946a42 100644
--- a/web/tvl/logo/default.nix
+++ b/web/tvl/logo/default.nix
@@ -21,20 +21,22 @@ let
 
   # Create an animated CSS that equally spreads out the colours over
   # the animation duration (1min).
-  animatedCss = colours: let
-    # Calculate at which percentage offset each colour should appear.
-    stepSize = 100 / ((builtins.length colours) - 1);
-    frames = lib.imap0 (idx: colour: { inherit colour; at = idx * stepSize; }) colours;
-    frameCss = frame: "${toString frame.at}% { fill: ${frame.colour}; }";
-  in ''
-    #armchair-background {
-      animation: 30s infinite alternate armchairPalette;
-    }
+  animatedCss = colours:
+    let
+      # Calculate at which percentage offset each colour should appear.
+      stepSize = 100 / ((builtins.length colours) - 1);
+      frames = lib.imap0 (idx: colour: { inherit colour; at = idx * stepSize; }) colours;
+      frameCss = frame: "${toString frame.at}% { fill: ${frame.colour}; }";
+    in
+    ''
+      #armchair-background {
+        animation: 30s infinite alternate armchairPalette;
+      }
 
-    @keyframes armchairPalette {
-    ${lib.concatStringsSep "\n" (map frameCss frames)}
-    }
-  '';
+      @keyframes armchairPalette {
+      ${lib.concatStringsSep "\n" (map frameCss frames)}
+      }
+    '';
 
   # Dark version of the logo, suitable for light backgrounds.
   darkCss = armchairCss: ''
@@ -67,7 +69,8 @@ let
     </svg>
   '';
 
-in depot.nix.readTree.drvTargets(lib.fix (self: {
+in
+depot.nix.readTree.drvTargets (lib.fix (self: {
   # Expose the logo construction functions.
   inherit palette darkCss lightCss animatedCss staticCss;
 
@@ -75,7 +78,7 @@ in depot.nix.readTree.drvTargets(lib.fix (self: {
   logoSvg = style: pkgs.writeText "logo.svg" (logoSvg style);
 
   # Create a PNG of the TVL logo with the specified style and DPI.
-  logoPng = style: dpi: pkgs.runCommandNoCC "logo.png" {} ''
+  logoPng = style: dpi: pkgs.runCommandNoCC "logo.png" { } ''
     ${pkgs.inkscape}/bin/inkscape \
       --export-area-drawing \
       --export-background-opacity 0 \
@@ -87,7 +90,8 @@ in depot.nix.readTree.drvTargets(lib.fix (self: {
   pastelRainbow = self.logoSvg (darkCss (animatedCss (lib.attrValues palette)));
 }
 
-# Add individual outputs for static dark logos of each colour.
-// (lib.mapAttrs'
-    (k: v: lib.nameValuePair "${k}Png"
-     (self.logoPng (darkCss (staticCss v)) 96)) palette)))
+  # Add individual outputs for static dark logos of each colour.
+  // (lib.mapAttrs'
+  (k: v: lib.nameValuePair "${k}Png"
+    (self.logoPng (darkCss (staticCss v)) 96))
+  palette)))
diff --git a/web/tvl/template/default.nix b/web/tvl/template/default.nix
index 6ccc10de6235..6b6a5b03038e 100644
--- a/web/tvl/template/default.nix
+++ b/web/tvl/template/default.nix
@@ -1,6 +1,7 @@
 { depot, pkgs, lib, ... }:
 
-{ # content of the <title> tag
+{
+  # content of the <title> tag
   title
   # main part of the page, usually wrapped with <main>
 , content
@@ -17,7 +18,8 @@ let
   inherit (depot.tools) cheddar;
 in
 
-runCommandNoCC "${lib.strings.sanitizeDerivationName title}-index.html" {
+runCommandNoCC "${lib.strings.sanitizeDerivationName title}-index.html"
+{
   headerPart = ''
     <!DOCTYPE html>
     <head>
@@ -36,11 +38,11 @@ runCommandNoCC "${lib.strings.sanitizeDerivationName title}-index.html" {
   inherit content;
 
   footerPart = ''
-    <hr>
-    <footer>
-      ${depot.web.tvl.footer args}
-    </footer>
-  </body>
+      <hr>
+      <footer>
+        ${depot.web.tvl.footer args}
+      </footer>
+    </body>
   '';
 
   passAsFile = [ "headerPart" "content" "footerPart" ];