Make minor adjustments to lib.nix

This commit is contained in:
Danila Fedorin 2021-10-23 00:33:22 -07:00
parent 30bd041431
commit 853dcaac4b

12
lib.nix
View File

@ -31,25 +31,25 @@ let
};
wrapHost = ssl: host: (if ssl then "https" else "http") + "//${host}";
in
lib = {
{
english = settings: website {
inherit (settings) drafts;
ssl = settings.ssl or false;
drafts = settings.drafts or false;
source = blog-source;
path = ".";
replaceUrl = {
from = "https://danilafe.com";
to = wrapHost settings.ssl settings.host;
to = wrapHost (settings.ssl or false) settings.host;
};
};
russian = settings: website {
inherit (settings) drafts;
ssl = settings.ssl or false;
drafts = settings.drafts or false;
source = blog-source-localized;
path = "ru";
replaceUrl = {
from = "https://ru.danilafe.com";
to = wrapHost settings.ssl settings.host;
};
to = wrapHost (settings.ssl or false) settings.host;
};
};
}