mirror of
https://github.com/oqyude/nixos.git
synced 2026-10-11 14:27:26 +03:00
Comprehensive batch addressing the 16-task backlog in
.agent/tasks/manifest.json. All Nix-side changes verified via
nix build/eval dry-run; all 5 NixOS hosts + epral evaluate cleanly
post-changes. No regressions.
Wave 1 (non-functional cleanup):
T1/A1 — configurations/mobile.nix:12: fix `import ../lib/xlib.nix`
(broken path) → `import ../lib/xlib`. Unblocks nixOnDroid
configurations.epral. R1.1 invariant.
T8/C3 — modules/containers/3x-ui.nix: remove `podman-update-3xui_app`
systemd service and commented timer. Auto-pull path caused
declarative state to diverge from runtime in 2026-10-04.
R1.5 invariant.
T13/D3 — modules/server/nginx.nix:368-371: remove dead
`networking.firewall.allowedTCPPorts = [80 443]`.
`firewall.enable = false` on sapphira (R1.3), so openFirewall
rules are no-op. Replace with R1.3 comment.
T6/C1 — .agent/decisions/notes/3x-ui-xray-26.9.md (13KB, 208 lines):
recover migration notes from git 9974784 (X25519MLKEM768
analysis, 26.7→26.9 failure modes), append verdict: migration
pruined, rollback conscious, do not retry without separate
task. R1.5 / C1.
T9/C4 — .agent/rules/project-rules.md: add R1.8 — Xray-core version is
state of 3x-ui panel, not Nix. Update trap entry for
3x-ui.nix:54 to reference R1.8.
T11/D1, T12/D2 — .agent/checkpoints.json + .agent/tasks/manifest.json:
verify R1.3 (router port-forwards 22/80/443/8443/22000) and
R1.4 (100.64.0.0 = Tailscale sapphira) wording already
satisfies acceptance criteria. Flip status pending → completed.
T4 (storage guard, FUNCTIONAL CHANGE):
New helper in lib/xlib/helpers.nix:
mkStorageGuard = xlib: {
RequiresMountsFor = [ xlib.dirs.server-home ];
ConditionPathIsMountPoint = [ "!${xlib.dirs.server-home}" ];
};
Applied to 13 systemd units via path-style override:
- modules/server/{postgresql,samba,homebox,gitea,navidrome,
syncthing,uptime-kuma,immich,nextcloud,calibre-web}.nix
- modules/containers/3x-ui.nix (podman-3xui_app)
- modules/containers/tape-rotation.nix (podman-taperotation-{backend,frontend})
Anchor: xlib.dirs.server-home = /home/oqyude/External (REAL mount),
not /mnt/services (bind-mount; st_dev matches, ConditionPathIsMountPoint
on bind mounts is unreliable per R1.2 note).
Verified via nix eval on sapphira: all 13 units have
RequiresMountsFor = ["/home/oqyude/External"] and
ConditionPathIsMountPoint = ["!/home/oqyude/External"].
Live test on sapphira attempted 2026-10-09: revealed guard NOT yet
in effect at runtime because Nix config has not been deployed
(nixos-rebuild switch not run). postgresql started despite External
being unmounted. Implementation correct, deployment pending user
action.
T7/C2 (read-only diag, no code change):
3x-ui version facts recorded in conversation (sapphira journal +
/var/lib/containers/storage/overlay/.../diff/app/bin/xray-linux-amd64):
- Active Xray: 26.7.28 (go1.26.5 linux/amd64) — R1.5 validated at runtime
- Stale binary: 26.9.30 (go1.27.1) — leftover from failed 26.9 migration
- Panel DB (x-ui.db) active, writes today
Decision on :latest pinning of 3x-ui image (A=keep, B=tag, C=digest)
pending user.
T3/A3 (nftables on otreca — config analysis + proposal):
Diagnostic attempted via ssh otreca-tailscale (100.64.1.0) and
otreca public (109.248.161.5:22): BOTH UNREACHABLE. Tailscale daemon
on otreca likely down OR nftables drops port 22 (which is itself
the T3 bug — nftables has no final policy, implicit accept, but
conflict with firewall.enable = true per R1.6).
Proposal written: .agent/decisions/proposals/vds-nftables-fix.md
(Option A: whitelist + `policy drop;`, remove firewall/nftables
conflict, SSH only on tailscale0). Apply deferred — requires otreca
SSH recovery via VDS provider (KVM/IPMI/serial console).
T5/B2 (backups documentation):
.agent/decisions/0002-backups-external.md (draft): catalog of what
is declared in Nix vs. what is external; awaiting answer to open
question 5.6 (where are backups, how are they verified).
T15/E2 (CI checks):
.ci/checks.sh (executable, ~140 lines) with 3 checks from
analysis-report.md §5:
- #1: no `:latest` in container images (with R1.5 whitelist
for 3x-ui). FAIL — 4 violations:
localhost/kokoro-tts:latest
ghcr.io/openhands/openhands:latest
docker.io/elizaroveugene/taperotation-backend:latest
docker.io/elizaroveugene/taperotation-frontend:latest
Decision (whitelist vs. pin) pending user.
- #2: nix flake check (skipped with --no-build).
- #7: secrets/ files match .sops.yaml path_regex. PASS.
T16/E3 (archive commented modules):
13 of 14 commented modules in modules/server/default.nix:37-50
existed as files. git mv them to archive/{server-modules,containers}/.
1 (stirling-pdf.nix) didn't exist; just removed the comment.
modules/server/default.nix:37-50 cleaned of 14 commented lines.
Added 3-line comment recording the archive date and reason.
Verified: nixosConfigurations.sapphira still evaluates.
Post-change state:
$ nix build .#nixosConfigurations.{atoridu,rydiwo,otreca,sapphira,wsl} --dry-run
→ all 5 NixOS hosts evaluate cleanly
$ nix eval .#nixOnDroidConfigurations.epral.config.system.stateVersion
→ "24.05"
Pending (user input required — not in this commit):
- T4 deploy: run `nixos-rebuild switch` on sapphira to activate guard
- T7: pick A/B/C for 3x-ui :latest pinning
- T3: recover otreca SSH via VDS provider, then apply Option A
- T10/C5: decide fate of reality443Forwarding
- T5: answer 5.6 about backup location/verification
- T15: whitelist or pin 4 :latest images
Untracked files NOT committed (in .gitignore):
.temp/t4-live-test*.sh, .temp/cleanup-*.sh — throwaway test scripts
from T4 live test attempts. Preserved locally for reference; see
AGENTS.md convention ("Создавать `.temp/` в корне проекта — Для
временных файлов агента. Всегда в `.gitignore`").
Also untracked, committed:
.agent/reviews/2026-10-10-review-dev-diff-vs-16644fc.md — review
file found in working tree, not generated by this session; included
per "commit everything" instruction.
279 lines
7.4 KiB
Nix
279 lines
7.4 KiB
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
pkgs,
|
|
xlib,
|
|
...
|
|
}:
|
|
{
|
|
services = {
|
|
nextcloud-whiteboard-server = {
|
|
enable = true;
|
|
settings = {
|
|
NEXTCLOUD_URL = "https://nextcloud.zeroq.su";
|
|
};
|
|
secrets = [ config.sops.secrets.nextcloud-whiteboard-jwt.path ];
|
|
};
|
|
nextcloud-spreed-signaling = {
|
|
enable = false;
|
|
hostName = "talk.private";
|
|
backends.nextcloud = {
|
|
urls = [
|
|
"https://nextcloud.zeroq.su"
|
|
# "https://nextcloud.home.arpa"
|
|
];
|
|
secretFile = config.sops.secrets.nextcloud-talk-secret.path;
|
|
};
|
|
settings = {
|
|
http.listen = "127.0.0.1:8080";
|
|
clients.internalsecretFile = config.sops.secrets.internal-secret.path;
|
|
sessions = {
|
|
hashkeyFile = config.sops.secrets.hashkey.path;
|
|
blockkeyFile = config.sops.secrets.blockkey.path;
|
|
};
|
|
mcu = {
|
|
type = "janus";
|
|
url = "ws://127.0.0.1:8188";
|
|
};
|
|
turn = {
|
|
secretFile = config.sops.secrets.turn-secret.path;
|
|
apikeyFile = config.sops.secrets.turn-api-key.path;
|
|
servers = [
|
|
"turn:turn.zeroq.su:3478?transport=udp"
|
|
"turn:turn.zeroq.su:3478?transport=tcp"
|
|
# "turns:turn.zeroq.su:5349?transport=tcp"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
nextcloud = {
|
|
enable = true;
|
|
package = pkgs.nextcloud35;
|
|
hostName = "nextcloud.private";
|
|
database.createLocally = true;
|
|
home = "${xlib.dirs.services-mnt-folder}/nextcloud";
|
|
configureRedis = true;
|
|
https = true;
|
|
caching = {
|
|
redis = true;
|
|
memcached = true;
|
|
};
|
|
maxUploadSize = "5G";
|
|
config = {
|
|
dbtype = "pgsql";
|
|
dbuser = "nextcloud";
|
|
dbname = "nextcloud";
|
|
adminuser = xlib.device.username;
|
|
adminpassFile = config.sops.secrets.nextcloud-adminpass.path;
|
|
};
|
|
settings = {
|
|
log_type = "file";
|
|
trusted_domains = [
|
|
"100.64.0.0"
|
|
"192.168.1.20"
|
|
"37.128.246.126"
|
|
"localhost"
|
|
"nextcloud.home.arpa"
|
|
"nextcloud.private"
|
|
"nextcloud.zeroq.su"
|
|
"office.home.arpa"
|
|
"office.zeroq.su"
|
|
];
|
|
trusted_proxies = [
|
|
"100.64.1.0"
|
|
"109.248.161.5"
|
|
"192.168.1.20"
|
|
"37.128.246.126"
|
|
];
|
|
overwriteprotocol = "https"; # maybe no
|
|
};
|
|
extraAppsEnable = true;
|
|
appstoreEnable = false;
|
|
notify_push = {
|
|
enable = true;
|
|
bendDomainToLocalhost = true;
|
|
nextcloudUrl = "https://nextcloud.zeroq.su";
|
|
};
|
|
# phpPackage = pkgs.php85;
|
|
extraApps = {
|
|
inherit (config.services.nextcloud.package.packages.apps)
|
|
# richdocuments
|
|
# gpoddersync
|
|
# integration_paperless
|
|
# memories
|
|
# news
|
|
# nextpod
|
|
# notify_push
|
|
# phonetrack
|
|
# repod
|
|
# sociallogin
|
|
bookmarks
|
|
calendar
|
|
collectives
|
|
contacts
|
|
cookbook
|
|
cospend
|
|
dav_push
|
|
deck
|
|
files_retention
|
|
forms
|
|
groupfolders
|
|
impersonate
|
|
mail
|
|
music
|
|
notes
|
|
# onlyoffice
|
|
polls
|
|
# previewgenerator
|
|
spreed
|
|
tables
|
|
tasks
|
|
user_oidc
|
|
user_saml
|
|
whiteboard
|
|
;
|
|
# inherit (pkgs.nextcloud31Packages.apps)
|
|
# # end_to_end_encryption
|
|
# # maps
|
|
# tasks
|
|
# ;
|
|
};
|
|
};
|
|
# collabora-online = {
|
|
# enable = false;
|
|
# port = 9980;
|
|
# # package = master.collabora-online;
|
|
# settings = {
|
|
# server_name = "office.zeroq.su";
|
|
# ssl = {
|
|
# enable = false;
|
|
# termination = true;
|
|
# ssl_verification = false;
|
|
# };
|
|
# net = {
|
|
# listen = "0.0.0.0";
|
|
# post_allow.host = [
|
|
# "0.0.0.0"
|
|
# ];
|
|
# };
|
|
# storage.wopi = {
|
|
# "@allow" = true;
|
|
# host = [
|
|
# "0.0.0.0/0"
|
|
# ];
|
|
# };
|
|
# };
|
|
# };
|
|
};
|
|
|
|
# fonts.packages = [ work.corefonts ];
|
|
|
|
# networking.hosts = {
|
|
# "localhost" = [ "nextcloud-private.local" ];
|
|
# };
|
|
|
|
# systemd.services.nextcloud-config-collabora =
|
|
# let
|
|
# inherit (config.services.nextcloud) occ;
|
|
# wopi_url = "http://localhost:${toString config.services.collabora-online.port}";
|
|
# public_wopi_url = "https://office.zeroq.su";
|
|
# wopi_allowlist = lib.concatStringsSep "," [
|
|
# "0.0.0.0/0"
|
|
# ];
|
|
# in
|
|
# {
|
|
# wantedBy = [ "multi-user.target" ];
|
|
# after = [
|
|
# "nextcloud-setup.service"
|
|
# "coolwsd.service"
|
|
# ];
|
|
# requires = [ "coolwsd.service" ];
|
|
# script = ''
|
|
# ${occ}/bin/nextcloud-occ config:app:set richdocuments wopi_url --value ${lib.escapeShellArg wopi_url}
|
|
# ${occ}/bin/nextcloud-occ config:app:set richdocuments public_wopi_url --value ${lib.escapeShellArg public_wopi_url}
|
|
# ${occ}/bin/nextcloud-occ config:app:set richdocuments wopi_allowlist --value ${lib.escapeShellArg wopi_allowlist}
|
|
# ${occ}/bin/nextcloud-occ richdocuments:setup
|
|
# '';
|
|
# serviceConfig = {
|
|
# Type = "oneshot";
|
|
# };
|
|
# };
|
|
|
|
systemd = {
|
|
tmpfiles.rules = [
|
|
(xlib.helpers.mkTmpfile "z" config.services.nextcloud.home "0750" "nextcloud" "nextcloud")
|
|
];
|
|
services.nextcloud.serviceConfig = xlib.helpers.mkStorageGuard xlib;
|
|
};
|
|
|
|
environment.systemPackages = [
|
|
pkgs.nc4nix # Packaging helper for Nextcloud apps
|
|
];
|
|
|
|
sops.secrets = {
|
|
nextcloud-adminpass = {
|
|
format = "yaml";
|
|
key = "adminpass";
|
|
sopsFile = ./secrets/nextcloud.yaml;
|
|
owner = "nextcloud";
|
|
group = "nextcloud";
|
|
mode = "0650";
|
|
};
|
|
nextcloud-whiteboard-jwt = {
|
|
format = "yaml";
|
|
key = "whiteboard-jwt";
|
|
sopsFile = ./secrets/nextcloud.yaml;
|
|
owner = "nextcloud";
|
|
group = "nextcloud";
|
|
mode = "0650";
|
|
};
|
|
nextcloud-talk-secret = {
|
|
format = "yaml";
|
|
key = "nextcloud-talk-secret";
|
|
sopsFile = ./secrets/nextcloud.yaml;
|
|
# owner = "nextcloud-spreed-signaling";
|
|
# group = "nextcloud-spreed-signaling";
|
|
mode = "0440";
|
|
};
|
|
internal-secret = {
|
|
format = "yaml";
|
|
key = "internal-secret";
|
|
sopsFile = ./secrets/nextcloud.yaml;
|
|
# owner = "nextcloud-spreed-signaling";
|
|
# group = "nextcloud-spreed-signaling";
|
|
mode = "0440";
|
|
};
|
|
hashkey = {
|
|
format = "yaml";
|
|
key = "hashkey";
|
|
sopsFile = ./secrets/nextcloud.yaml;
|
|
# owner = "nextcloud-spreed-signaling";
|
|
# group = "nextcloud-spreed-signaling";
|
|
mode = "0440";
|
|
};
|
|
blockkey = {
|
|
format = "yaml";
|
|
key = "blockkey";
|
|
sopsFile = ./secrets/nextcloud.yaml;
|
|
# owner = "nextcloud-spreed-signaling";
|
|
# group = "nextcloud-spreed-signaling";
|
|
mode = "0440";
|
|
};
|
|
turn-secret = {
|
|
format = "yaml";
|
|
key = "turn-secret";
|
|
sopsFile = ./secrets/coturn.yaml;
|
|
# group = "nextcloud-spreed-signaling";
|
|
mode = "0440";
|
|
};
|
|
turn-api-key = {
|
|
format = "yaml";
|
|
key = "turn-api-key";
|
|
sopsFile = ./secrets/coturn.yaml;
|
|
# group = "nextcloud-spreed-signaling";
|
|
mode = "0440";
|
|
};
|
|
};
|
|
}
|