refactor(nix): consolidate fragmented attribute-path writes

Same owner written as '.a = ...; .b = ...;' repeated dotted paths is now one
attrset block. Behaviour-preserving (values, list order and comments kept):

- 3xui-reconfig description/serviceConfig in server/ and vds/ (separate units,
  different PANEL_URL - deliberately not extracted into a shared module)
- authelia after/wants inside the existing config = mkIf wrapper
- gitea-actions-runner settings: runner/metrics/health_check/container
- boot.loader.grub, services.logind, pxe-infra.bridge, pipewire.alsa
- nix.{distributedBuilds,buildMachines}; nix.settings on WSL (mkForce kept)
- build.activation on termux (nix-on-droid freeform)

Also in this commit: lamet.opencodes.zeroq.su upstream 6061 -> 4096
(verified by nix eval of the vhost proxyPass).

nix-instantiate --parse: 12/12 files OK.
This commit is contained in:
oqyude committed 2026-10-25 02:10:05 +03:00
1 parent 69691f96d1
commit 066b3acec1
11 files changed
+95 -66

No files matched your search

+4 -2
View File
@@ -192,8 +192,10 @@ in
# creates to deploy credentials; depending on its name avoids the
# "race between tmpfiles-setup and the sops materialiser" that the
# previous tmpfiles-symlink design implicitly relied on.
systemd.services.authelia.after = [ "sops-nix.service" ];
systemd.services.authelia.wants = [ "sops-nix.service" ];
systemd.services.authelia = {
after = [ "sops-nix.service" ];
wants = [ "sops-nix.service" ];
};
# sops wiring. Guarded by builtins.pathExists so the flake still
# evaluates when ./secrets/authelia.yaml hasn't been created yet —
+4 -2
View File
@@ -102,8 +102,10 @@ in
# populated. (The build-machine list still lands in /etc/nix/machines
# but nix-daemon reads `builders`, not /etc/nix/machines, when
# distributedBuilds is false.)
nix.distributedBuilds = true;
nix.buildMachines = map forNix config.host.builder.clients;
nix = {
distributedBuilds = true;
buildMachines = map forNix config.host.builder.clients;
};
# Nix 2.34's daemon does not act on `@/etc/nix/machines` (the file
# format NixOS's nix-remote-build writes to): the `builders` config
# key is parsed for display but `external-builders` stays empty and
+13 -10
View File
@@ -76,16 +76,19 @@
#
# В otreca аналогичный юнит определён в `modules/vds/default.nix` с
# другим `PANEL_URL`/`apiToken`.
systemd.services."3xui-reconfig".serviceConfig.Type = "oneshot";
systemd.services."3xui-reconfig".serviceConfig.ExecStart =
lib.getExe config.modules."3x-ui".reconfig;
systemd.services."3xui-reconfig".serviceConfig.Environment = [
"PANEL_URL=https://127.0.0.1:2049"
"PANEL_BASE=@base"
"PANEL_TOKEN=@api_token"
];
systemd.services."3xui-reconfig".description =
"Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18).";
systemd.services."3xui-reconfig" = {
description =
"Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18).";
serviceConfig = {
Type = "oneshot";
ExecStart = lib.getExe config.modules."3x-ui".reconfig;
Environment = [
"PANEL_URL=https://127.0.0.1:2049"
"PANEL_BASE=@base"
"PANEL_TOKEN=@api_token"
];
};
};
# engipy webapp — split architecture:
# - sapphira : host.engipy-frontend.enable → nginx vhost (engipy.zeroq.su)
# с /api/* на rydiwo:8000 и / → /var/lib/engipy/web
+22 -14
View File
@@ -56,24 +56,30 @@ in
labels = [ "native:host" ]; # only host-executor; no docker required
settings = {
runner.capacity = 1; # sequential on 2-core host
runner.timeout = "2h";
runner.workdir_cleanup_age = "48h";
runner.idle_cleanup_interval = "20m";
runner = {
capacity = 1; # sequential on 2-core host
timeout = "2h";
workdir_cleanup_age = "48h";
idle_cleanup_interval = "20m";
};
# Localhost-only. Co-resident processes can still reach it; scrape
# via ssh+localhost if ever needed.
metrics.enabled = true;
metrics.addr = "127.0.0.1:9101";
metrics = {
enabled = true;
addr = "127.0.0.1:9101";
};
# Workspace in /tmp is tmpfs (size = ~50% of RAM ≈ 2.8 GiB
# on sapphira), so the default 4 GB threshold would always trip.
# 256 MiB is plenty for smoke-test workflows and still trips
# meaningfully if tmpfs truly fills.
health_check.enabled = true;
health_check.min_free_disk_space_mb = 256;
health_check.interval = "5m";
health_check.timeout = "30s";
health_check = {
enabled = true;
min_free_disk_space_mb = 256;
interval = "5m";
timeout = "30s";
};
# Workspace in /tmp (tmpfs). Same approach as GH Actions runners —
# ephemeral, always writable by the runner's UID. Avoids racing with
@@ -85,10 +91,12 @@ in
host.workdir_parent = "/tmp/gitea-runner-work";
# Defence in depth even though host labels never pull images.
container.docker_host = "";
container.network = "";
container.privileged = false;
container.options = "";
container = {
docker_host = "";
network = "";
privileged = false;
options = "";
};
};
# The PATH of every host-mode job. One shared list (lib/ci-tools.nix) with
+1 -1
View File
@@ -471,7 +471,7 @@ in
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://100.106.21.39:6061";
proxyPass = "http://100.106.21.39:4096";
proxyWebsockets = true;
};
};