setup new backend for da site

This commit is contained in:
jacekpoz 2024-05-22 12:10:48 +02:00
parent f93a496539
commit 886686816b
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 51 additions and 3 deletions

View file

@ -3366,6 +3366,26 @@
"type": "github"
}
},
"pozsite": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1716371791,
"narHash": "sha256-E9ieGAAIE7fj56ZXux2ET0OEgODytNXw0pQQ0AYH4kg=",
"ref": "refs/heads/master",
"rev": "8c3aa3d3b3937caeeb46153f3812a240d2e0a04d",
"revCount": 172,
"type": "git",
"url": "ssh://jacekpoz/jacekpoz/pozsite.git"
},
"original": {
"type": "git",
"url": "ssh://jacekpoz/jacekpoz/pozsite.git"
}
},
"quickshell": {
"inputs": {
"nixpkgs": [
@ -3427,6 +3447,7 @@
"nixpkgs-wayland": "nixpkgs-wayland",
"nur": "nur",
"nvf": "nvf",
"pozsite": "pozsite",
"quickshell": "quickshell",
"schizofox": "schizofox",
"shadower": "shadower",

View file

@ -99,5 +99,10 @@
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
inputs.nixpkgs.follows = "nixpkgs";
};
pozsite = {
url = "git+ssh://jacekpoz/jacekpoz/pozsite.git";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}

View file

@ -1,13 +1,35 @@
_: {
{
inputs,
pkgs,
...
}: let
port = 4827;
in {
services.caddy = {
enable = true;
virtualHosts."jacekpoz.pl".extraConfig = ''
root * /srv/web/jacekpoz.pl
file_server
reverse_proxy localhost:${toString port}
'';
virtualHosts."jpoz.pl".extraConfig = ''
redir / https://jacekpoz.pl
redir /git https://jacekpoz.pl/posts/git-workflow.html
'';
};
systemd.services.pozback = {
description = "The backend for jacekpoz.pl";
wantedBy = ["default.target"];
serviceConfig = {
Type = "simple";
ExecStart = "${inputs.pozsite.packages.${pkgs.system}.pozback}/bin/back";
Restart = "on-failure";
Environment = ''ROCKET_PORT="${toString port}" ROCKET_WEB_DIR="/srv/web/jacekpoz.pl"'';
};
path = with pkgs; [
fastfetch
colorized-logs
];
};
}