mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-19 16:03:41 +00:00
feat: self-host delta at delta.harivan.sh
Add delta systemd service on port 3300 with nginx reverse proxy, ACME SSL, and WebAuthn/OAuth env config. Also update README with current service list.
This commit is contained in:
parent
1d506fb37c
commit
00338266e0
4 changed files with 63 additions and 2 deletions
48
hosts/netty/delta.nix
Normal file
48
hosts/netty/delta.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
let
|
||||
deltaPort = "3300";
|
||||
stateDir = "/var/lib/delta";
|
||||
repoDir = "/home/${username}/Documents/GitHub/delta";
|
||||
envFile = "${stateDir}/delta.env";
|
||||
dbPath = "${stateDir}/data.db";
|
||||
in
|
||||
{
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${stateDir} 0750 ${username} users -"
|
||||
"z ${envFile} 0600 ${username} users -"
|
||||
];
|
||||
|
||||
systemd.services.delta = {
|
||||
description = "Delta - Self-hosted Todo Platform";
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
NODE_ENV = "production";
|
||||
HOSTNAME = "127.0.0.1";
|
||||
PORT = deltaPort;
|
||||
DATABASE_URL = dbPath;
|
||||
OAUTH_REDIRECT_BASE_URL = "https://delta.harivan.sh";
|
||||
WEBAUTHN_ORIGIN = "https://delta.harivan.sh";
|
||||
WEBAUTHN_RP_ID = "delta.harivan.sh";
|
||||
};
|
||||
|
||||
path = [ pkgs.nodejs_22 ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = username;
|
||||
Group = "users";
|
||||
WorkingDirectory = repoDir;
|
||||
ExecStart = "${repoDir}/node_modules/.bin/next start --port ${deltaPort} --hostname 127.0.0.1";
|
||||
EnvironmentFile = "-${envFile}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue