update website

This commit is contained in:
kp2pml30 2025-04-12 23:39:07 +04:00
parent 5057d037cb
commit 83d3fff168
Signed by: kp2pml30
GPG key ID: CD6528BAC23E3E34
7 changed files with 250 additions and 10 deletions

View file

@ -1,16 +1,50 @@
{ config
, pkgs
, lib
, self
, nixpkgs
, kp2pml30-moe
, system
, ...
}@args:
let
cfg = config.kp2pml30.server;
src = builtins.fetchGit {
url = "https://github.com/kp2pml30/kp2pml30.github.io.git";
rev = "855fb5c51c439179aeedf83e1b0ecdb0d4385023";
};
pack = (import "${src}/release.nix" args);
backend = kp2pml30-moe.packages.${system}.kp2pml30-moe-backend;
frontend = kp2pml30-moe.packages.${system}.kp2pml30-moe-frontend;
in lib.mkIf cfg.nginx {
environment.systemPackages = [ pack ];
kp2pml30.server.sitePath = pack.outPath;
environment.systemPackages = [
frontend
];
kp2pml30.server.sitePath = frontend.outPath;
users.users.kp2pml30-moe-backend = {
home = "/home/kp2pml30-moe-backend";
isNormalUser = true;
packages = [
backend
];
};
systemd.services.kp2pml30-moe-backend-service = {
enable = true;
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "kp2pml30-moe-backend";
ProtectSystem = "full";
ProtectHostname = "true";
ProtectKernelTunables = "true";
ProtectControlGroups = "true";
Restart = "on-failure";
RestartSec = "3";
ExecStart = ''bash -c "source /home/kp2pml30-moe-backend/env.sh && touch /home/kp2pml30-moe-backend/db.json && ${backend} --port 8001 --moderated-path /home/kp2pml30-moe-backend/chatbox-db.json"'';
};
};
}