refactor(web/todolist): omit unnecessary intermediate drv

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>
This commit is contained in:
zseri 2021-12-27 02:25:27 +01:00 committed by clbot
parent 9b3374b091
commit ee62cda9a5

View file

@ -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
''
}