D'instáil mé mo bhlag féin — go príomha chun aithne níos fearr a chur ar #NixOS. Is ionadh é chomh simplí is a bhí sé ar fad.
Tá WriteFreely an-oiriúnach chuige seo: íosmhéid, socrú tapa, agus gan aon bhallasta gan ghá. Tá sé foirfe chun tosú go héasca agus rud éigin a fhoghlaim ag an am céanna. Tá an chumraíocht thar a bheith soiléir. Cúpla rogha socraithe, eolaire ullmhaithe, seachfhreastalaí droim ar ais os a chomhair — sin é.
Seo mar a bhreathnaíonn mo chumraíocht NixOS reatha dó:
{ config, pkgs, ... }:
{
services.writefreely = {
enable = true;
host = "blog.burningboard.org";
settings = {
server = {
port = 8080;
min_log_level = "debug";
};
app = {
host = "https://blog.burningboard.org";
single_user = true;
landing = "/read";
wf_modesty = true;
federation = true;
public_stats = true;
theme = "write";
};
};
stateDir = "/opt/writefreely";
};
# Socrú do ghiniúint eochracha ActivityPub: teastaíonn openssl don chónaidhm
systemd.services.writefreely.path = [ pkgs.openssl ];
# Cruthú uathoibríoch an eolaire sonraí leis na ceadanna cearta
systemd.tmpfiles.rules = [
"d /opt/writefreely 0700 writefreely writefreely -"
];
services.caddy.virtualHosts."blog.burningboard.org".extraConfig = ''
reverse_proxy 127.0.0.1:8080 {
header_up Host {host}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
}
'';
}
Sin é go bunúsach. Déanann NixOS an-éasca é seirbhísí mar seo a chumrú go néata agus iad a choinneáil in-atáirgthe.