Use Nix function to perform replacement

This commit is contained in:
2022-05-01 20:12:41 +00:00
parent 0f22123471
commit 1c0c7355c1
3 changed files with 8 additions and 10 deletions

View File

@@ -7,11 +7,9 @@ let
inherit (settings) src ssl host;
name = "blog-static";
version = settings.src.rev;
urlSub =
let
regexEscape = lib.escape [ "/" "(" ")" "[" "]" "+" "*" "\\" ];
in
with settings.replaceUrl; "s/${regexEscape from}/${regexEscape to}/g";
postPatch = with settings.replaceUrl; ''
substituteInPlace config.toml --replace ${from} ${to}
'';
publicPath = settings.path;
extraFlags = (if settings.drafts then " -D " else "") + settings.extraFlags;
builder = ./build/builder.sh;