Skip to content

Add typed feature flag options to NixOS module#843

Merged
svarlamov merged 1 commit intomainfrom
johnw/nixos-module
Mar 28, 2026
Merged

Add typed feature flag options to NixOS module#843
svarlamov merged 1 commit intomainfrom
johnw/nixos-module

Conversation

@jwiegley
Copy link
Copy Markdown
Collaborator

@jwiegley jwiegley commented Mar 28, 2026

Summary

  • Replace the freeform featureFlags JSON attrset with individually typed boolean options for each known feature flag (asyncMode, rewriteStash, interCommitMove, authKeyring, gitHooksEnabled, gitHooksExternallyManaged)
  • Add extraFlags escape hatch for forward-compatible unknown flags
  • Add missing enterprise-latest and enterprise-next values to updateChannel enum

Motivation

Nix users cannot run git ai config set feature_flags.async_mode true because config.json lives in the Nix store (read-only). Typed options make async daemon mode and other feature flags accessible through the module system:

programs.git-ai = {
  enable = true;
  settings.featureFlags.asyncMode = true;
};

Applied to both the NixOS module and Home Manager module.

Test plan

  • nix flake check --no-build passes
  • Verify config.json output contains "feature_flags": {"async_mode": true} when asyncMode = true
  • Verify omitted flags produce no feature_flags key in config.json
  • Verify extraFlags values are included but overridden by typed options

🤖 Generated with Claude Code


Open with Devin

Replace the freeform featureFlags attrset (jsonFormat.type) with
individually typed boolean options for each known feature flag from
feature_flags.rs: asyncMode, rewriteStash, interCommitMove,
authKeyring, gitHooksEnabled, and gitHooksExternallyManaged.

This allows Nix users to enable async daemon mode via:

  programs.git-ai.settings.featureFlags.asyncMode = true;

rather than needing `git ai config set feature_flags.async_mode true`,
which cannot modify config.json when it lives in the Nix store.

Typed options take precedence over the extraFlags escape hatch
(for forward-compatible unknown flags). Also adds enterprise-latest
and enterprise-next to the updateChannel enum.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@svarlamov svarlamov merged commit a84f302 into main Mar 28, 2026
18 of 21 checks passed
@svarlamov svarlamov deleted the johnw/nixos-module branch March 28, 2026 03:28
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.

2 participants