mirror of
https://github.com/kp2pml30/dotfiles.git
synced 2026-02-17 07:44:41 +04:00
update website
This commit is contained in:
parent
5057d037cb
commit
83d3fff168
7 changed files with 250 additions and 10 deletions
|
|
@ -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"'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue