From d34c527372e0a6b8dcb0d9796451b987c953a88e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 25 Mar 2021 20:14:48 +0200 Subject: refactor: Replace some uses of builtins.toFile with pkgs.writeText I'm looking at removing some of these because they can cause unnecessary build steps during CI pipeline generation. Change-Id: I84742968918090c050d2eedab8a1b42692632a42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2655 Reviewed-by: sterni Tested-by: BuildkiteCI --- users/tazjin/blog/fragments.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'users/tazjin/blog') diff --git a/users/tazjin/blog/fragments.nix b/users/tazjin/blog/fragments.nix index fb750a729910..78a64afa3932 100644 --- a/users/tazjin/blog/fragments.nix +++ b/users/tazjin/blog/fragments.nix @@ -10,7 +10,7 @@ { depot, lib, ... }: let - inherit (builtins) filter map hasAttr replaceStrings toFile; + inherit (builtins) filter map hasAttr replaceStrings; inherit (depot.third_party) runCommandNoCC writeText; inherit (depot.users.tazjin) renderMarkdown; @@ -51,7 +51,7 @@ let ''; - draftWarning = toFile "draft.html" '' + draftWarning = writeText "draft.html" ''

Note: This post is a draft! Please do not share the link to it without asking me first. @@ -59,7 +59,7 @@ let


''; - unlistedWarning = toFile "unlisted.html" '' + unlistedWarning = writeText "unlisted.html" ''

Note: This post is unlisted! Please do not share the link to it without asking me first. @@ -68,7 +68,7 @@ let ''; renderPost = post: runCommandNoCC "${post.key}.html" {} '' - cat ${toFile "header.html" (header post.title)} > $out + cat ${writeText "header.html" (header post.title)} > $out # Write the post title & date echo '

${escape post.title}

' >> $out @@ -89,7 +89,7 @@ let cat ${renderMarkdown post.content} >> $out echo '
' >> $out - cat ${toFile "footer.html" footer} >> $out + cat ${writeText "footer.html" footer} >> $out ''; in { inherit renderPost isDraft isUnlisted; -- cgit 1.4.1