feat(server): HF-plant
This commit is contained in:
@@ -24,5 +24,6 @@
|
||||
./immich.nix
|
||||
|
||||
./efl.nix
|
||||
./plant.nix
|
||||
];
|
||||
}
|
||||
|
||||
74
config/hosts/imxyy-nix-server/plant.nix
Normal file
74
config/hosts/imxyy-nix-server/plant.nix
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
app = pkgs.buildNpmPackage (finalAttrs: {
|
||||
pname = "HF-plant";
|
||||
version = "unstable-2025-09-21";
|
||||
|
||||
src = inputs.plant;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
npm run build
|
||||
npm run build:proxy
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir $out
|
||||
mv dist $out
|
||||
cp .env proxy-server-bundled.js $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
npmDepsHash = "sha256-ret4BtjrEt8L1nlvJmFiejAKmbz89Z7NSiKs+qlB51w=";
|
||||
});
|
||||
in
|
||||
{
|
||||
systemd.services.HF-plant-proxy = {
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${lib.getExe pkgs.bash} -c 'source ${app}/.env; export FEISHU_APP_ID FEISHU_APP_SECRET AMAP_JSCODE; ${lib.getExe pkgs.nodejs} ${app}/proxy-server-bundled.js'";
|
||||
Restart = "always";
|
||||
RestartSec = 120;
|
||||
};
|
||||
};
|
||||
services.caddy.virtualHosts."plant.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
handle /api/* {
|
||||
reverse_proxy localhost:3001
|
||||
}
|
||||
|
||||
handle /* {
|
||||
root * ${app}/dist
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
'';
|
||||
};
|
||||
services.frp.settings.proxies = [
|
||||
{
|
||||
name = "plant-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "plant.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "plant-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "plant.imxyy.top" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
18
flake.lock
generated
18
flake.lock
generated
@@ -993,6 +993,23 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plant": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1758423341,
|
||||
"narHash": "sha256-dHcKh7T8I70bKPwgqO5MxZ9bWHINwzRPhFp5waQy2r8=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "08dc0b3889797eb3618c7475c3c367ec0e5fdf40",
|
||||
"revCount": 6,
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.imxyy.top:2222/imxyy1soope1/HF-plant.git"
|
||||
},
|
||||
"original": {
|
||||
"rev": "08dc0b3889797eb3618c7475c3c367ec0e5fdf40",
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.imxyy.top:2222/imxyy1soope1/HF-plant.git"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"catppuccin": "catppuccin",
|
||||
@@ -1012,6 +1029,7 @@
|
||||
"nixpkgs-master": "nixpkgs-master",
|
||||
"nixpkgs-stable": "nixpkgs-stable_2",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"plant": "plant",
|
||||
"sops-nix": "sops-nix",
|
||||
"stylix": "stylix",
|
||||
"zen": "zen"
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
zen.url = "github:0xc000022070/zen-browser-flake";
|
||||
zen.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
plant.url = "git+ssh://git@git.imxyy.top:2222/imxyy1soope1/HF-plant.git?rev=08dc0b3889797eb3618c7475c3c367ec0e5fdf40";
|
||||
plant.flake = false;
|
||||
|
||||
catppuccin.url = "github:catppuccin/nix";
|
||||
catppuccin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user