diff options
author | Vincent Ambo <mail@tazj.in> | 2021-03-25T18·14+0200 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-03-25T19·14+0000 |
commit | d34c527372e0a6b8dcb0d9796451b987c953a88e (patch) | |
tree | be88657a95ddac7ed5d9f0978f00712c8f675238 /users/tazjin/blog/fragments.nix | |
parent | d01d6bb63db9da000dd1b3c8491a6c0d43877c29 (diff) |
refactor: Replace some uses of builtins.toFile with pkgs.writeText r/2329
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 <sternenseemann@systemli.org> Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/blog/fragments.nix')
-rw-r--r-- | users/tazjin/blog/fragments.nix | 10 |
1 files changed, 5 insertions, 5 deletions
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 </body> ''; - draftWarning = toFile "draft.html" '' + draftWarning = writeText "draft.html" '' <p class="cheddar-callout cheddar-warning"> <b>Note:</b> This post is a <b>draft</b>! Please do not share the link to it without asking me first. @@ -59,7 +59,7 @@ let <hr> ''; - unlistedWarning = toFile "unlisted.html" '' + unlistedWarning = writeText "unlisted.html" '' <p class="cheddar-callout cheddar-warning"> <b>Note:</b> This post is <b>unlisted</b>! 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 '<article><h2 class="inline">${escape post.title}</h2>' >> $out @@ -89,7 +89,7 @@ let cat ${renderMarkdown post.content} >> $out echo '</article>' >> $out - cat ${toFile "footer.html" footer} >> $out + cat ${writeText "footer.html" footer} >> $out ''; in { inherit renderPost isDraft isUnlisted; |