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}"; wrapHost = ssl: host: (if ssl then "https" else "http") + "//${host}";
in in
lib = { {
english = settings: website { english = settings: website {
inherit (settings) drafts;
ssl = settings.ssl or false; ssl = settings.ssl or false;
drafts = settings.drafts or false;
source = blog-source; source = blog-source;
path = "."; path = ".";
replaceUrl = { replaceUrl = {
from = "https://danilafe.com"; from = "https://danilafe.com";
to = wrapHost settings.ssl settings.host; to = wrapHost (settings.ssl or false) settings.host;
}; };
}; };
russian = settings: website { russian = settings: website {
inherit (settings) drafts;
ssl = settings.ssl or false; ssl = settings.ssl or false;
drafts = settings.drafts or false;
source = blog-source-localized; source = blog-source-localized;
path = "ru"; path = "ru";
replaceUrl = { replaceUrl = {
from = "https://ru.danilafe.com"; from = "https://ru.danilafe.com";
to = wrapHost settings.ssl settings.host; to = wrapHost (settings.ssl or false) settings.host;
}; };
}; };
}; }