chore(soldtime): Cleanup options

This commit is contained in:
Tibo De Peuter 2026-02-10 08:30:11 +01:00
parent 2a392b0581
commit 04b4254a72
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
3 changed files with 42 additions and 27 deletions

View file

@ -11,6 +11,7 @@
}; };
traefik.enable = true; traefik.enable = true;
plex.enable = true; plex.enable = true;
solidtime.enable = true;
}; };
virtualisation.guest.enable = true; virtualisation.guest.enable = true;
}; };

View file

@ -9,6 +9,7 @@
./homepage ./homepage
./jellyfin ./jellyfin
./plex ./plex
./solidtime
./speedtest ./speedtest
./technitium-dns ./technitium-dns
./traefik ./traefik

View file

@ -5,10 +5,10 @@ let
networkName = "solidtime"; networkName = "solidtime";
internalNetworkName = "solidtime-internal"; internalNetworkName = "solidtime-internal";
proxyNet = config.homelab.apps.traefiik.sharedNetworkName;
version = "0.8.0"; version = "0.8.0";
port = 8000;
user = "1000:1000"; user = "1000:1000";
# dbExternalPort = ...; # dbExternalPort = ...;
@ -30,7 +30,7 @@ let
VITE_APP_NAME = laravelEnv.APP_NAME; VITE_APP_NAME = laravelEnv.APP_NAME;
APP_ENV = "production"; APP_ENV = "production";
APP_DEBUG = "false"; APP_DEBUG = "false";
APP_URL = "http://localhost:${toString port}"; APP_URL = "http://localhost:${toString cfg.port}";
APP_FORCE_HTTPS = "false"; APP_FORCE_HTTPS = "false";
APP_ENABLE_REGISTRATION = "false"; APP_ENABLE_REGISTRATION = "false";
TRUSTED_PROXIES = "0.0.0.0/0,2000:0:0:0:0:0:0:0/3"; TRUSTED_PROXIES = "0.0.0.0/0,2000:0:0:0:0:0:0:0/3";
@ -70,7 +70,15 @@ let
}; };
in { in {
options.homelab.apps.solidtime.enable = lib.mkEnableOption "Solidtime time tracker using Docker"; options.homelab.apps.solidtime = {
enable = lib.mkEnableOption "Solidtime time tracker using Docker";
port = lib.mkOption {
type = lib.types.int;
default = 8000;
description = "Solidtime WebUI port";
};
exposePort = lib.mkEnableOption "Expose Soldtime port";
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
homelab.virtualisation.containers.enable = true; homelab.virtualisation.containers.enable = true;
@ -117,52 +125,54 @@ in {
solidtime = { solidtime = {
hostname = "solidtime"; hostname = "solidtime";
image = "solidtime/solidtime:${version}"; image = "solidtime/solidtime:${version}";
autoStart = true;
inherit user; inherit user;
autoStart = true;
dependsOn = [
"solidtimeDb"
];
ports = [ ports = [
# Open ports if you don't use Traefik # Open ports if you don't use Traefik
"${toString port}:8000" "${toString cfg.port}:8000"
];
networks = [
networkName
internalNetworkName
]; ];
extraOptions = [ extraOptions = [
"--network=${networkName}"
"--network=${internalNetworkName}"
# Healthecks # Healthecks
# test: [ "CMD-SHELL", "curl --fail http://localhost:8000/health-check/up || exit 1" ] # test: [ "CMD-SHELL", "curl --fail http://localhost:8000/health-check/up || exit 1" ]
''--health-cmd=curl --fail http://localhost:8000/health-check/up || exit 1'' ''--health-cmd=curl --fail http://localhost:8000/health-check/up || exit 1''
]; ];
inherit volumes; inherit volumes;
dependsOn = [ labels = {
"solidtimeDb" "traefik.enable" = "true";
]; "traefik.http.routers.solidtime.rule" = "Host(`time.${config.networking.hostName}.depeuter.dev`)";
"traefik.http.services.solidtime.loadbalancer.server.port" = toString cfg.port;
};
environmentFiles = [ environmentFiles = [
"/home/admin/.solidtime.env" "/home/admin/.solidtime.env"
]; ];
environment = laravelEnv // { environment = laravelEnv // {
CONTAINER_MODE = "http"; CONTAINER_MODE = "http";
}; };
labels = {
"traefik.enable" = "true";
"traefik.http.routers.solidtime.rule" = "Host(`time.${config.networking.hostName}.depeuter.dev`)";
"traefik.http.services.solidtime.loadbalancer.server.port" = toString port;
};
}; };
solidtimeScheduler = { solidtimeScheduler = {
hostname = "scheduler"; hostname = "scheduler";
image = "solidtime/solidtime:${version}"; image = "solidtime/solidtime:${version}";
inherit user; inherit user;
autoStart = true; autoStart = true;
dependsOn = [
"solidtimeDb"
];
networks = [
internalNetworkName
];
extraOptions = [ extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks # Healthchecks
# test: [ "CMD-SHELL", "supervisorctl status scheduler:scheduler_00" ] # test: [ "CMD-SHELL", "supervisorctl status scheduler:scheduler_00" ]
''--health-cmd="supervisorctl status scheduler:scheduler_00"'' ''--health-cmd="supervisorctl status scheduler:scheduler_00"''
]; ];
inherit volumes; inherit volumes;
dependsOn = [
"solidtimeDb"
];
environmentFiles = [ environmentFiles = [
"/home/admin/.solidtime.env" "/home/admin/.solidtime.env"
]; ];
@ -175,9 +185,10 @@ in {
image = "solidtime/solidtime:${version}"; image = "solidtime/solidtime:${version}";
inherit user; inherit user;
autoStart = true; autoStart = true;
networks = [
internalNetworkName
];
extraOptions = [ extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks # Healthchecks
# test: [ "CMD-SHELL", "supervisorctl status worker:worker_00" ] # test: [ "CMD-SHELL", "supervisorctl status worker:worker_00" ]
''--health-cmd="supervisorctl status worker:worker_00"'' ''--health-cmd="supervisorctl status worker:worker_00"''
@ -201,9 +212,10 @@ in {
ports = [ ports = [
# "${toString dbExternalPort}:${toString dbInternalPort}" # "${toString dbExternalPort}:${toString dbInternalPort}"
]; ];
networks = [
internalNetworkName
];
extraOptions = [ extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks # Healthchecks
# test: - CMD - pg_isready - '-q' - '-d' - '${DB_DATABASE}' - '-U' - '${DB_USERNAME}' retries: 3 timeout: 5s # test: - CMD - pg_isready - '-q' - '-d' - '${DB_DATABASE}' - '-U' - '${DB_USERNAME}' retries: 3 timeout: 5s
''--health-cmd="pg_isready -q -d ${laravelEnv.DB_DATABASE} -U ${laravelEnv.DB_USERNAME}"'' ''--health-cmd="pg_isready -q -d ${laravelEnv.DB_DATABASE} -U ${laravelEnv.DB_USERNAME}"''
@ -224,9 +236,10 @@ in {
hostname = "gotenberg"; hostname = "gotenberg";
image = "gotenberg/gotenberg:8"; image = "gotenberg/gotenberg:8";
autoStart = true; autoStart = true;
networks = [
internalNetworkName
];
extraOptions = [ extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks # Healthchecks
# test: [ "CMD", "curl", "--silent", "--fail", "http://localhost:3000/health" ] # test: [ "CMD", "curl", "--silent", "--fail", "http://localhost:3000/health" ]
''--health-cmd="curl --silent --fail http://localhost:${toString gotenbergPort}/health"'' ''--health-cmd="curl --silent --fail http://localhost:${toString gotenbergPort}/health"''