Skip to content

Nix module fixes: storage formatting, DynamicUser, logging#221

Open
ananthb wants to merge 6 commits intoOverclock-Validator:devfrom
ananthb:fix/vote-nil-root-and-slot-log
Open

Nix module fixes: storage formatting, DynamicUser, logging#221
ananthb wants to merge 6 commits intoOverclock-Validator:devfrom
ananthb:fix/vote-nil-root-and-slot-log

Conversation

@ananthb
Copy link
Copy Markdown

@ananthb ananthb commented Mar 27, 2026

Summary

  • Fix nix storage formatting: Rewrite format scripts with proper blkid error handling (exit codes 0=found, 2=no fs, other=error) instead of swallowing errors with || true. Add device unit dependencies so format services wait for devices. Refactor duplicate format logic into a shared mkFormatScript. Add dataDir option to decouple external storage from systemd StateDirectory.
  • Fix DynamicUser for external storage: Switch to DynamicUser=true and chown external mount points so the dynamic user can write to root-owned filesystems after mkfs. Run ExecStartPre scripts with elevated privileges (+). Resolve config paths to mount points directly.
  • Fix logging configuration: Replace logToStdout boolean with logTarget enum (file/journald/both). Only create LogsDirectory when file logging is enabled. Make LOGS_DIRECTORY optional in config init script.
  • Fix format disk force mode: When force=true, skip reformatting if the existing filesystem already matches the requested type. Previously it wiped and reformatted on every boot.

Supersedes #220.

@ananthb ananthb force-pushed the fix/vote-nil-root-and-slot-log branch from 7ff33d6 to e726360 Compare March 27, 2026 20:13
@ananthb ananthb force-pushed the fix/vote-nil-root-and-slot-log branch from e726360 to 4705800 Compare April 3, 2026 21:33
@ananthb ananthb changed the title Vote nil root and slot log Nix module fixes: storage formatting, DynamicUser, logging Apr 3, 2026
@ananthb ananthb force-pushed the fix/vote-nil-root-and-slot-log branch from 4705800 to ff26fb4 Compare April 9, 2026 18:18
ananthb and others added 6 commits April 12, 2026 03:44
Rewrite format scripts with proper blkid error handling instead of
swallowing all errors with || true. Add device unit dependencies so
format services wait for devices. Refactor duplicate format logic into
a shared mkFormatScript function. Add dataDir option to decouple
external storage paths from systemd StateDirectory.
Switch to DynamicUser=true and chown external mount points so the
dynamic user can write to root-owned filesystems after mkfs. Run
ExecStartPre scripts with elevated privileges (+) and resolve config
paths to mount points directly instead of StateDirectory placeholders.
Replace logToStdout boolean with logTarget enum (file/journald/both)
for explicit control over log destinations. Only create LogsDirectory
and configure file-based log settings when file logging is enabled.
Make LOGS_DIRECTORY optional in config init script.
When force=true, the format script was wiping and reformatting the disk
on every boot, even when the filesystem already matched the requested
type. Now it only force-formats when the existing filesystem differs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unused fileLoggingEnabled binding in shared/lib.nix and apply
statix inherit-from suggestions in storage.nix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ananthb ananthb force-pushed the fix/vote-nil-root-and-slot-log branch from e3761f2 to b7b6bd8 Compare April 11, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant