forked from SWISDATA/processintel
nix.module: smaller issues in the NixOS module #61
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#61
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: low (a list of small fixes; items 3 and 4 can stop evaluation or nginx on some hosts)
Where
module.nixProblem
Collection of smaller problems in
module.nix:"Deleting tmp files in: $d", but$dis never set, so the log line is always empty.-type f), sosession_*directories accumulate (#20).domainNameAliaseshas nodefault, so it is mandatory although described as an optional alias list. Evaluation fails if it is not set.access_log … json_analyticsrequires alog_format json_analyticsthat this module never defines, so nginx fails to start unless the host config defines it.locations."/stream"targets the pre-1.18 Streamlit WebSocket path (current:/_stcore/stream). The block is dead config; the/location already proxies WebSockets.self.packages.${pkgs.system}usespkgs.system, deprecated in recent nixpkgs (usepkgs.stdenv.hostPlatform.system).logLevelis a free-formstr, so typos are accepted and only fail at runtime in Python logging config. Usetypes.enum.MemoryMax,CPUQuota,TasksMax) on a service that runs user-controlled heavy computations (#31).ExecStartPostpolls for the socket withsleep 1and 10 retries. On slow starts the unit fails although the app is fine. Asystemd.socketunit orType=notifywould be more robust.Steps to reproduce
(Item 3) Enable the module without setting
domainNameAliases; evaluation fails.(Item 4) Enable the module on a host that does not define
log_format json_analytics; nginx fails to start.Expected behavior
The module evaluates and nginx starts with only the documented required options set.
Actual behavior
See the table above.
Related: #20, #31.
Fix
Address each item individually as described in the table. Items 3, 4 and 8 have the most impact.
from
issues/DEP-002-nixos-module-minor-issues.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
Item 3 is refuted in the pinned Nix environment. I evaluated
nixosSystemwith this module enabled and onlydomainName='review.example'set, leavingdomainNameAliasesunset;services.nginx.virtualHosts."review.example".serverAliasesevaluates successfully to[]. The list option obtains its empty value through the module/type machinery, so the missing explicitdefaultdoes not produce the claimed evaluation failure. An explicitdefault = []can still improve clarity.Item 9's suggested alternatives need prerequisites:
Type=notifyrequires the application to send readiness notifications, and socket activation requires accepting an inherited listening descriptor. The current entrypoint only exposes host/port/socket-path options. Neither is a drop-in unit-only fix. The undefined$d, file-only cleanup, undeclaredjson_analytics, network/resource concerns and fragile polling remain supported.Code references: module.nix:118, module.nix:218, module.nix:286.