mob next [ci-skip] [ci skip] [skip ci]
lastFile:modules/nixos/think-gtcm.nix
This commit is contained in:
99
.nixos-test-history
Normal file
99
.nixos-test-history
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
|
||||||
|
# 2025-11-24 13:55:37.811567
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 13:56:20.311688
|
||||||
|
+print("ls ")
|
||||||
|
|
||||||
|
# 2025-11-24 13:56:54.776584
|
||||||
|
+print(node1.execute("ls"))
|
||||||
|
|
||||||
|
# 2025-11-24 13:58:28.668534
|
||||||
|
+print(node1.execute("systemctl list-units --state=running"))
|
||||||
|
|
||||||
|
# 2025-11-24 13:58:54.403671
|
||||||
|
+print(node1.execute("systemctl list-units --state=running")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:04:23.706300
|
||||||
|
+print(node1.execute("curl localhost")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:05:12.009677
|
||||||
|
+print(node1.execute("ls /run/phpfpm")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:05:18.190057
|
||||||
|
+print(node1.execute("ls /run/")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:06:13.672107
|
||||||
|
+print(node1.execute("systemctl status phpfpm")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:06:30.998281
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:06:46.415493
|
||||||
|
+print(node1.execute("systemctl restart phpfpm-think-greaterchiangmai")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:07:04.587586
|
||||||
|
+print(node1.execute("journalctl -u phpfpm-think-greaterchiangmai")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:07:23.281828
|
||||||
|
+print(node1.execute("systemctl restart phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:25:55.937596
|
||||||
|
+sta
|
||||||
|
|
||||||
|
# 2025-11-24 14:26:00.037215
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 14:26:31.056466
|
||||||
|
+print(node1.execute("systemctl restart phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:26:41.419197
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:28:23.086227
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 14:34:38.031180
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 14:35:05.524404
|
||||||
|
+print(node1.execute("curl localhost")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 15:28:41.942140
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 15:38:58.983582
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 15:39:05.916438
|
||||||
|
+print(node1.execute("curl localhost")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 15:40:35.187547
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 15:41:03.024846
|
||||||
|
+print(node1.execute("curl localhost")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 15:45:28.552055
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 15:55:45.706557
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 15:56:20.761495
|
||||||
|
+print(node1.execute("composer")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 15:58:05.766218
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 15:58:41.171176
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 16:04:34.457301
|
||||||
|
+start_all()
|
||||||
|
|
||||||
|
# 2025-11-24 16:18:15.123805
|
||||||
|
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||||
|
|
||||||
|
# 2025-11-24 16:26:24.656220
|
||||||
|
+start_all()
|
||||||
@@ -84,63 +84,54 @@
|
|||||||
name = "pocket-id";
|
name = "pocket-id";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
module = {
|
module = {
|
||||||
name = "nextcloud";
|
name = "nextcloud";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
stirling-pdf = {
|
stirling-pdf = {
|
||||||
module = {
|
module = {
|
||||||
name = "stirling-pdf";
|
name = "stirling-pdf";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
actual-budget = {
|
actual-budget = {
|
||||||
module = {
|
module = {
|
||||||
name = "actual-budget";
|
name = "actual-budget";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
victoriametrics = {
|
victoriametrics = {
|
||||||
module = {
|
module = {
|
||||||
name = "victoriametrics";
|
name = "victoriametrics";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
vikunja = {
|
vikunja = {
|
||||||
module = {
|
module = {
|
||||||
name = "vikunja";
|
name = "vikunja";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
grafana = {
|
grafana = {
|
||||||
module = {
|
module = {
|
||||||
name = "grafana";
|
name = "grafana";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
pingvin = {
|
pingvin = {
|
||||||
module = {
|
module = {
|
||||||
name = "pingvin";
|
name = "pingvin";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
paperless = {
|
paperless = {
|
||||||
module = {
|
module = {
|
||||||
name = "paperless";
|
name = "paperless";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,8 +6,19 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.think-greaterchiangmai;
|
cfg = config.services.think-greaterchiangmai;
|
||||||
|
think-gtcm = pkgs.think-gtcm.override { dataDir = cfg.dataDir; };
|
||||||
|
think-backend-gtcm = pkgs.think-backend-gtcm.override { dataDir = cfg.dataDir; };
|
||||||
defaultUser = "gtcm";
|
defaultUser = "gtcm";
|
||||||
defaultGroup = "gtcm";
|
defaultGroup = "gtcm";
|
||||||
|
|
||||||
|
env-nonfile-values = lib.attrsets.filterAttrs (n: v: !lib.strings.hasSuffix "_FILE" n) cfg.settings;
|
||||||
|
|
||||||
|
think-gtcm-maintenance = pkgs.writeShellScript "think-gtcm-maintenance.sh" ''
|
||||||
|
set -a
|
||||||
|
${lib.strings.toShellVars env-nonfile-values}
|
||||||
|
set +a
|
||||||
|
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.think-greaterchiangmai = {
|
options.services.think-greaterchiangmai = {
|
||||||
@@ -111,13 +122,6 @@ in
|
|||||||
PUSHER_PORT=443
|
PUSHER_PORT=443
|
||||||
PUSHER_SCHEME=https
|
PUSHER_SCHEME=https
|
||||||
PUSHER_APP_CLUSTER=mt1
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
VITE_APP_NAME="''${APP_NAME}"
|
|
||||||
VITE_PUSHER_APP_KEY="''${PUSHER_APP_KEY}"
|
|
||||||
VITE_PUSHER_HOST="''${PUSHER_HOST}"
|
|
||||||
VITE_PUSHER_PORT="''${PUSHER_PORT}"
|
|
||||||
VITE_PUSHER_SCHEME="''${PUSHER_SCHEME}"
|
|
||||||
VITE_PUSHER_APP_CLUSTER="''${PUSHER_APP_CLUSTER}"
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
@@ -215,28 +219,47 @@ in
|
|||||||
log_errors = on
|
log_errors = on
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.think-gtcm-setup = {
|
||||||
|
description = "think.greaterchiangmai installation";
|
||||||
|
requiredBy = [ "phpfpm-think-greaterchiangmai.service" ];
|
||||||
|
before = [ "phpfpm-think-greaterchiangmai.service" ];
|
||||||
|
requires = [ "mysql.service" ];
|
||||||
|
after = [ "mysql.service" ];
|
||||||
|
path = [ config.services.phpfpm.phpPackage ];
|
||||||
|
serviceConfig = {
|
||||||
|
RemainAfterExit = true;
|
||||||
|
User = cfg.user;
|
||||||
|
UMask = 77;
|
||||||
|
WorkingDirectory = "${agorakit}";
|
||||||
|
RuntimeDirectory = "agorakit/cache";
|
||||||
|
RuntimeDirectoryMode = 700;
|
||||||
|
ExecStart = think-gtcm-maintenance;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts."${cfg.domain}" = {
|
virtualHosts."${cfg.domain}" = {
|
||||||
root = "${cfg.package}/share/php/think-gtcm/public";
|
root = "${cfg.package}/share/php/think-gtcm/public";
|
||||||
locations."~ \\.php$".extraConfig = ''
|
locations."~ \\.php$".extraConfig = ''
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools.think-greaterchiangmai.socket};
|
fastcgi_pass unix:${config.services.phpfpm.pools.think-greaterchiangmai.socket};
|
||||||
fastcgi_index site.php;
|
fastcgi_index index.php;
|
||||||
'';
|
|
||||||
extraConfig = ''
|
|
||||||
index index.php;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
virtualHosts."${cfg.backendDomain}" = {
|
|
||||||
root = "${cfg.packageBackend}/share/php/think-backend-gtcm/public";
|
|
||||||
locations."~ \\.php$".extraConfig = ''
|
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools.think-greaterchiangmai.socket};
|
|
||||||
fastcgi_index site.php;
|
|
||||||
'';
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
index index.php;
|
index index.php;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
# virtualHosts."${cfg.backendDomain}" = {
|
||||||
|
# root = "${cfg.packageBackend}/share/php/think-backend-gtcm/public";
|
||||||
|
# locations."~ \\.php$".extraConfig = ''
|
||||||
|
# fastcgi_pass unix:${config.services.phpfpm.pools.think-greaterchiangmai.socket};
|
||||||
|
# fastcgi_index index.php;
|
||||||
|
# '';
|
||||||
|
# extraConfig = ''
|
||||||
|
# index index.php;
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
fetchgit,
|
fetchgit,
|
||||||
php,
|
php,
|
||||||
|
dataDir ? "/var/lib/think-backend-gtcm",
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
repoSrc = fetchgit {
|
repoSrc = fetchgit {
|
||||||
@@ -16,6 +17,16 @@ php.buildComposerProject2 (finalAttrs: {
|
|||||||
|
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out
|
||||||
|
cp -R * $out
|
||||||
|
rm -rf $out/storage
|
||||||
|
ln -s ${dataDir}/.env $out/.env
|
||||||
|
ln -s ${dataDir}/storage $out/storage
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
composerStrictValidation = false;
|
composerStrictValidation = false;
|
||||||
vendorHash = "sha256-eXm1x3E9KHWojaT2RU4inMdZqQVcWdLCKlvzhOlIZrc=";
|
vendorHash = "sha256-eXm1x3E9KHWojaT2RU4inMdZqQVcWdLCKlvzhOlIZrc=";
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
fetchgit,
|
fetchgit,
|
||||||
php,
|
php,
|
||||||
|
dataDir ? "/var/lib/think-gtcm",
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
repoSrc = fetchgit {
|
repoSrc = fetchgit {
|
||||||
@@ -16,6 +17,16 @@ php.buildComposerProject2 (finalAttrs: {
|
|||||||
|
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out
|
||||||
|
cp -R * $out
|
||||||
|
rm -rf $out/storage
|
||||||
|
ln -s ${dataDir}/.env $out/.env
|
||||||
|
ln -s ${dataDir}/storage $out/storage
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
composerStrictValidation = false;
|
composerStrictValidation = false;
|
||||||
vendorHash = "sha256-QV3hR3U3GwCqrCRxfkazmJwDpO1vFyMfA6YqUb4bjMI=";
|
vendorHash = "sha256-QV3hR3U3GwCqrCRxfkazmJwDpO1vFyMfA6YqUb4bjMI=";
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,6 +9,52 @@
|
|||||||
imports = [ self.nixosModules.think-gtcm ];
|
imports = [ self.nixosModules.think-gtcm ];
|
||||||
services.think-greaterchiangmai = {
|
services.think-greaterchiangmai = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
APP_NAME = "Laravel";
|
||||||
|
APP_ENV = "local";
|
||||||
|
APP_KEY = "";
|
||||||
|
APP_DEBUG = "true";
|
||||||
|
APP_URL = "http://localhost";
|
||||||
|
|
||||||
|
LOG_CHANNEL = "stack";
|
||||||
|
LOG_DEPRECATIONS_CHANNEL = "null";
|
||||||
|
LOG_LEVEL = "debug";
|
||||||
|
|
||||||
|
DB_CONNECTION = "mysql";
|
||||||
|
DB_HOST = "localhost";
|
||||||
|
DB_PORT = 3306;
|
||||||
|
DB_DATABASE = "thinkgtcm";
|
||||||
|
DB_USERNAME = "thinkgtcm";
|
||||||
|
DB_PASSWORD = "";
|
||||||
|
|
||||||
|
BROADCAST_DRIVER = "log";
|
||||||
|
CACHE_DRIVER = "file";
|
||||||
|
FILESYSTEM_DISK = "local";
|
||||||
|
QUEUE_CONNECTION = "sync";
|
||||||
|
SESSION_DRIVER = "file";
|
||||||
|
SESSION_LIFETIME = "120";
|
||||||
|
|
||||||
|
MEMCACHED_HOST = "127.0.0.1";
|
||||||
|
|
||||||
|
REDIS_HOST = "127.0.0.1";
|
||||||
|
REDIS_PASSWORD = "null";
|
||||||
|
REDIS_PORT = "6379";
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID = "";
|
||||||
|
AWS_SECRET_ACCESS_KEY = "";
|
||||||
|
AWS_DEFAULT_REGION = "us-east-1";
|
||||||
|
AWS_BUCKET = "";
|
||||||
|
AWS_USE_PATH_STYLE_ENDPOINT = "false";
|
||||||
|
|
||||||
|
PUSHER_APP_ID = "";
|
||||||
|
PUSHER_APP_KEY = "";
|
||||||
|
PUSHER_APP_SECRET = "";
|
||||||
|
PUSHER_HOST = "";
|
||||||
|
PUSHER_PORT = 443;
|
||||||
|
PUSHER_SCHEME = "https";
|
||||||
|
PUSHER_APP_CLUSTER = "mt1";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user