vps1: reorganize data a bit

This commit is contained in:
Lgmrszd 2024-05-15 22:14:50 +03:00
parent 2f1cf4f40e
commit e158c95133
No known key found for this signature in database
GPG key ID: 9396B8BA6FBB14DE
5 changed files with 15 additions and 8 deletions

View file

@ -1,6 +1,6 @@
{ pkgs, config, data, ... }:
let
inherit (data.services) rootDomain;
inherit (data.host) rootDomain;
gtnhDomain = "gtnh.${rootDomain}";
discDomain = "discourse.testdrive.${rootDomain}";
akkoDomain = "akko429164.testdrive.${rootDomain}";

View file

@ -1,3 +1,12 @@
{
let
host = builtins.fromTOML (builtins.readFile ./host.toml);
rootDomain = host.rootDomain;
services = builtins.fromTOML (builtins.readFile ./services.toml);
in
{
inherit host;
services = builtins.mapAttrs (name: values:
values //
(if values ? subdomain then {domain = "${values.subdomain}.${rootDomain}";} else {})
) services;
}

View file

@ -0,0 +1 @@
rootDomain = "lgmrszd.xyz"

View file

@ -1,5 +1,3 @@
rootDomain = "lgmrszd.xyz"
[git]
subdomain = "git"
sshPort = 22631

View file

@ -1,9 +1,8 @@
# Big thanks to Pyrox for their config! https://git.pyrox.dev/pyrox/nix/src/branch/main/hosts/marvin/services/git.nix
{ lib, pkgs, config, data, ... }:
let
inherit (data.services) rootDomain;
domain = "${data.services.git.subdomain}.${rootDomain}";
gitSSHPort = data.services.git.sshPort;
inherit (data.host) rootDomain;
inherit (data.services.git) domain sshPort;
cfg = config.services.forgejo;
srv = cfg.settings.server;
@ -40,7 +39,7 @@ in
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3001;
SSH_PORT = gitSSHPort;
SSH_PORT = sshPort;
};
DEFAULT = {
APP_NAME = "Lgmrszd's git";