wow
This commit is contained in:
commit
8593aae296
5 changed files with 1419 additions and 12 deletions
1329
flake.lock
generated
Normal file
1329
flake.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -25,6 +25,10 @@
|
||||||
reverse_proxy 10.11.8.102:9080
|
reverse_proxy 10.11.8.102:9080
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
virtualHosts."orbitrender-exp.mizuki.guru".extraConfig = ''
|
||||||
|
reverse_proxy 10.20.30.192:3000
|
||||||
|
'';
|
||||||
|
|
||||||
virtualHosts."plutos.dazzle.st".extraConfig = ''
|
virtualHosts."plutos.dazzle.st".extraConfig = ''
|
||||||
reverse_proxy localhost:13000
|
reverse_proxy localhost:13000
|
||||||
'';
|
'';
|
||||||
|
|
@ -33,6 +37,13 @@
|
||||||
reverse_proxy localhost:9794
|
reverse_proxy localhost:9794
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
virtualHosts."wiki.icetang.xyz".extraConfig = ''
|
||||||
|
reverse_proxy localhost:51337 {
|
||||||
|
header_up X-Real-IP {client_ip}
|
||||||
|
header_up X-Forwarded-For {client_ip}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
virtualHosts."pve.hikari.icn.mizuki.guru".extraConfig = ''
|
virtualHosts."pve.hikari.icn.mizuki.guru".extraConfig = ''
|
||||||
reverse_proxy https://10.11.8.100:8006 {
|
reverse_proxy https://10.11.8.100:8006 {
|
||||||
header_up X-Real-Ip {remote_host}
|
header_up X-Real-Ip {remote_host}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,75 @@
|
||||||
{ inputs, pkgs, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nodeModules = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
pname = "cfwithoutincident-node-modules";
|
||||||
|
version = "1.0.50";
|
||||||
|
src = inputs.cfwithoutincident;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.bun ];
|
||||||
|
dontConfigure = true;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
export HOME="$TMPDIR/home"
|
||||||
|
export BUN_INSTALL_CACHE_DIR="$TMPDIR/bun-cache"
|
||||||
|
mkdir -p "$HOME" "$BUN_INSTALL_CACHE_DIR"
|
||||||
|
|
||||||
|
bun install \
|
||||||
|
--frozen-lockfile \
|
||||||
|
--ignore-scripts \
|
||||||
|
--no-progress \
|
||||||
|
--production
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p "$out"
|
||||||
|
cp -R node_modules "$out/"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Bun dependencies are fetched in this fixed-output derivation, so the
|
||||||
|
# regular build remains network-independent and reproducible.
|
||||||
|
dontFixup = true;
|
||||||
|
outputHash = "sha256-FrYyXCpzunrA92NQ9ffrmjJaPTFiTlCsW8OXdpt4m28=";
|
||||||
|
outputHashAlgo = "sha256";
|
||||||
|
outputHashMode = "recursive";
|
||||||
|
};
|
||||||
|
|
||||||
|
cfwithoutincident = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
pname = "cfwithoutincident";
|
||||||
|
version = "1.0.50";
|
||||||
|
src = inputs.cfwithoutincident;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.bun ];
|
||||||
|
dontConfigure = true;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
cp -R ${nodeModules}/node_modules .
|
||||||
|
bun build --compile --minify src/index.ts --outfile cfwithoutincident
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
install -Dm755 cfwithoutincident "$out/bin/cfwithoutincident"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontFixup = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
systemd.services.cfwithoutincident = {
|
systemd.services.cfwithoutincident = {
|
||||||
description = "Cloudflare Status D-Day dashboard";
|
description = "Cloudflare Status D-Day dashboard";
|
||||||
|
|
@ -11,21 +81,12 @@
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
User = "imnyang";
|
User = "imnyang";
|
||||||
Group = "users";
|
Group = "users";
|
||||||
WorkingDirectory = "/var/lib/cfwithoutincident";
|
|
||||||
Environment = [
|
Environment = [
|
||||||
"PORT=31774"
|
"PORT=31774"
|
||||||
];
|
];
|
||||||
ExecStartPre = [
|
ExecStart = "${cfwithoutincident}/bin/cfwithoutincident";
|
||||||
"${pkgs.coreutils}/bin/cp -r ${inputs.cfwithoutincident}/. /var/lib/cfwithoutincident/"
|
|
||||||
"${pkgs.bun}/bin/bun install --frozen-lockfile"
|
|
||||||
];
|
|
||||||
ExecStart = "${pkgs.bun}/bin/bun run src/index.ts";
|
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
StateDirectory = "cfwithoutincident";
|
|
||||||
StateDirectoryMode = "0755";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
path = [ pkgs.bun ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
# darwin-configuration.nix
|
# darwin-configuration.nix
|
||||||
{ inputs, pkgs, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
|
let
|
||||||
|
nixcordPackages = inputs.nixcord.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.nixcord.darwinModules.nixcord ];
|
imports = [ inputs.nixcord.darwinModules.nixcord ];
|
||||||
|
|
||||||
|
|
@ -8,7 +11,7 @@
|
||||||
user = "imnyang"; # Needed for system-level config
|
user = "imnyang"; # Needed for system-level config
|
||||||
|
|
||||||
discord = {
|
discord = {
|
||||||
package = pkgs.discord-canary;
|
package = nixcordPackages.discord-canary;
|
||||||
equicord.enable = true;
|
equicord.enable = true;
|
||||||
branches = [ "canary" ];
|
branches = [ "canary" ];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,10 @@ in
|
||||||
"github.com/RussellLuo/caddy-ext/ratelimit@v0.3.0"
|
"github.com/RussellLuo/caddy-ext/ratelimit@v0.3.0"
|
||||||
"github.com/neodyme-labs/user_agent_parse@v0.0.1"
|
"github.com/neodyme-labs/user_agent_parse@v0.0.1"
|
||||||
];
|
];
|
||||||
hash = "sha256-sh5R+MqWfzYJ6GTRHW0rmnz1D5l91ULaSyupcGvEatA=";
|
hash = {
|
||||||
|
"x86_64-linux" = "sha256-r4MgRk8HpKYx7f8FmA3PKgD/5ZNTIHpQvlE+zRbP0lw=";
|
||||||
|
"aarch64-linux" = "sha256-AfCiPSLCrZeKRJV6CRE6ps96lyinbgxaVnEpwLXPHMk=";
|
||||||
|
}.${pkgs.stdenv.hostPlatform.system};
|
||||||
};
|
};
|
||||||
globalConfig = ''
|
globalConfig = ''
|
||||||
admin unix//run/caddy/admin.socket
|
admin unix//run/caddy/admin.socket
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue