fix: small fixes to the blog

This commit is contained in:
Patrick 2024-09-01 17:07:24 +02:00
parent aab0cc5e2b
commit 21872334fa
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F

View file

@ -1,16 +1,14 @@
{ { pkgs, lib, ... }:
pkgs,
lib,
...
}:
let let
prestart = pkgs.writeShellScript "pr-tracker-pre" '' prestart = pkgs.writeShellScript "blog-pre" ''
if [ ! -f ./ssh_key ]; then if [ ! -d ./.ssh ]; then
ssh-keygen -t ed25519 -N "" -f ssh_key mkdir .ssh
fi
if [ ! -f ./.ssh/id_ed25519 ]; then
ssh-keygen -t ed25519 -N "" -f .ssh/id_ed25519
fi fi
${lib.getExe pkgs.git} config core.sshCommand 'ssh -i ~/ssh_key'
if [ ! -d ./blog ]; then if [ ! -d ./blog ]; then
${lib.getExe pkgs.git} clone ssh://git@forge.lel.lol:9922/patrick/blog.git |\ ${lib.getExe pkgs.git} clone --recurse-submodules ssh://git@forge.lel.lol:9922/patrick/blog.git |\
echo "failed to clone the repository did you forget to add the ssh key?" echo "failed to clone the repository did you forget to add the ssh key?"
fi fi
''; '';
@ -18,15 +16,18 @@ in
{ {
wireguard.elisabeth = { wireguard.elisabeth = {
client.via = "elisabeth"; client.via = "elisabeth";
firewallRuleForNode.elisabeth.allowedTCPPorts = [ 3000 ]; firewallRuleForNode.elisabeth.allowedTCPPorts = [ 80 ];
}; };
services.nginx = { services.nginx = {
enable = true; enable = true;
user = "blog"; user = "blog";
virtualHosts."blog.lel.lol" = { virtualHosts."blog.lel.lol" = {
root = "/var/lib/blog/blog/public"; root = "/var/lib/blog/blog/public/public";
}; };
}; };
programs.ssh.knownHosts = {
"[forge.lel.lol]:9922".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOWoGqHwkLVFXJwYcKs3CjQognvlZmROUIgkvvUgNalx";
};
environment.persistence."/persist".directories = [ environment.persistence."/persist".directories = [
{ {
directory = "/var/lib/blog"; directory = "/var/lib/blog";