Migrate Redview to Lyra native service #163
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!163
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/lyra-redview-cutover"
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?
Refs #35
Summary
Migrates Redview from Nova’s Docker stack to Lyra’s native NixOS service.
/var/lib/redview.Validation
nix flake checkpasses.just testactivation succeeded.redview.serviceis healthy locally at/health.Remaining before merge
WIP: Migrate Redview to Lyra native serviceto Migrate Redview to Lyra native serviceAutomated code review
Reviewed commit:
989753ed4020ad12e0fc1cd366b4041b7d6f4193Verdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The PR introduces a native Redview service module with SOPS secret management, NFS mount configuration, and systemd dependency ordering. Three actionable findings were identified: heavy CUDA package evaluation outside the conditional guard, a potential startup failure due to a missing subdirectory in ExecStartPre, and redundant systemd mount options.
Blocking findings
None.
Important findings
Heavy CUDA evaluation outside conditional guard (modules/services/redview.nix:18; high confidence)
cudaPkgs = import inputs.nixpkgs {
system = pkgs.stdenv.hostPlatform.system;
config = {
allowUnfree = true;
cudaSupport = true;
cudaCapabilities = [ "8.9" ];
};
};
Impact: The CUDA Python environment and its dependencies are evaluated at module load time, even when nixosConfig.redview.enable is false. This wastes CI/local build resources and violates standard NixOS module scoping practices.
Suggested fix: Move the cudaPkgs and redviewPython definitions inside the mkIf cfg.enable { ... } block so they are only evaluated when the service is actually enabled.
ExecStartPre may fail due to missing subdirectory (modules/services/redview.nix:194; high confidence)
${pkgs.coreutils}/bin/install -m 0600 ${
config.sops.templates."redview-bdfr-config".path
} /var/lib/redview/bdfr-config/config.cfg
Impact: The install command copies the BDFR config to a nested path. If /var/lib/redview/bdfr-config/ does not exist (e.g., upstream tmpfiles only creates /var/lib/redview), systemd will fail the pre-start step and block service activation.
Suggested fix: Add mkdir -p /var/lib/redview/bdfr-config to ExecStartPre, or verify that the upstream redview module's tmpfiles rules create this subdirectory and adjust the dependency accordingly.
Suggestions
"x-systemd.requires=network-online.target"
"x-systemd.after=network-online.target"
Impact: Both requires and after imply ordering relative to network-online.target. Using both is redundant and slightly inflates the fstab entry without changing behavior.
Suggested fix: Remove x-systemd.requires (keeping after is standard for NFS mounts).
Tests and validation
Questions
Review limitations
Diff coverage
.sops.yaml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchflake.lock: reviewed — included in a context-limited batchflake.nix: reviewed — included in a context-limited batchhosts/lyra/default.nix: reviewed — included in a context-limited batchmodules/services/redview.nix: reviewed — included in a context-limited batchsecrets/redview.yaml: reviewed — included in a context-limited batchReview metadata
Thanks for the review. I investigated all three findings against the evaluated configuration and live Lyra deployment; no code change is needed.
CUDA binding scope — Nix
letbindings are lazy.cudaPkgsandredviewPythonare referenced only insidemkIf cfg.enable, so they are not forced when Redview is disabled. In addition, this module is imported only by Lyra.nix flake checkpasses across all hosts.BDFR config directory — the upstream Redview module declares a tmpfiles rule for
${cfg.bdfrConfigDir}. On the real Lyra activation, theExecStartPre installstep successfully created/var/lib/redview/bdfr-config/config.cfg, and the service started and completed its health check.NFS ordering —
After=network-online.targetprovides ordering only if that target is pulled in;Requires=network-online.targetalso pulls it into the transaction. Keeping both is intentional for an NFS mount.The live service additionally completed a WireGuard-proxied BDFR rip startup with no host network-administration capability.