about summary refs log tree commit diff
path: root/web/todolist
diff options
context:
space:
mode:
authorzseri <zseri.devel@ytrizja.de>2021-12-27T01·25+0100
committerclbot <clbot@tvl.fyi>2021-12-27T01·32+0000
commitee62cda9a5887cc15e32e184d10265a705aae2e0 (patch)
treef2830173d96cb254d2d4129bd61e18821989b4bf /web/todolist
parent9b3374b0914bc40672cf8adf4649d1e27d0226f2 (diff)
refactor(web/todolist): omit unnecessary intermediate drv r/3448
also import yants functions explicitly

Change-Id: Idd16d130a95efc30216cb54051c7193a42978003
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4689
Tested-by: BuildkiteCI
Reviewed-by: zseri <zseri.devel@ytrizja.de>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: zseri <zseri.devel@ytrizja.de>
Diffstat (limited to 'web/todolist')
-rw-r--r--web/todolist/default.nix22
1 files changed, 13 insertions, 9 deletions
diff --git a/web/todolist/default.nix b/web/todolist/default.nix
index 938902f315..a2fcb501bd 100644
--- a/web/todolist/default.nix
+++ b/web/todolist/default.nix
@@ -4,14 +4,12 @@
 # only for users that are known to us.
 { depot, lib, pkgs, ... }:
 
-with depot.nix.yants;
-
 let
   inherit (pkgs)
     jq
     ripgrep
     runCommandNoCC
-    writeText
+    writeTextFile
     ;
 
   inherit (builtins)
@@ -25,6 +23,13 @@ let
 
   inherit (lib) concatStringsSep;
 
+  inherit (depot.nix.yants)
+    defun
+    int
+    string
+    struct
+    ;
+
   knownUsers = map (u: u.username) depot.ops.users;
 
   todo = struct {
@@ -68,7 +73,10 @@ let
 
   staticUrl = "https://static.tvl.fyi/${depot.web.static.drvHash}";
 
-  todoPage = writeText "index.html" ''
+in writeTextFile {
+  name = "tvl-todos";
+  destination = "/index.html";
+  text = ''
     <!DOCTYPE html>
     <head>
       <meta charset="utf-8">
@@ -104,8 +112,4 @@ let
       </footer>
     </body>
   '';
-
-in runCommandNoCC "tvl-todos" {} ''
-  mkdir $out
-  cp ${todoPage} $out/index.html
-''
+}