diff --git a/AGENTS.md b/AGENTS.md index f9f09c0..581c62d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -116,6 +116,11 @@ Four pkgs sets are threaded everywhere as `pkgsFlakes` / `pkgs'` (and `hmFlakes` channel via `nixpkgs` / `home-manager` / `hmNixpkgs` options (e.g. `nixpkgs = "mine-stable"`). Modules receive `pkgs'` = an attrset of all channels for the current system. +For options absent from older channels, omit the attribute with `optionalAttrs` guarded by +the module's `options` argument. `mkIf false` still checks option existence. Add a `TODO` +comment explaining which older release needs the guard and which release upgrade allows +its removal, matching the existing release-gated TODOs. + ### `lib.my` and the `my` option namespace `lib/default.nix` extends `lib` with a `my` attrset (helpers like `mkOpt'`, `mkBoolOpt'`, `mkDefault'`, `inlineModule'`, `mkDefaultSystemsPkgs`, `homeStateVersion`). It also pulls in: diff --git a/home-manager/modules/gui/default.nix b/home-manager/modules/gui/default.nix index 4726d31..1eafcaa 100644 --- a/home-manager/modules/gui/default.nix +++ b/home-manager/modules/gui/default.nix @@ -1,6 +1,6 @@ -{ lib, pkgs', pkgs, inputs, config, ... }: +{ lib, pkgs', pkgs, inputs, config, options, ... }: let - inherit (lib) genAttrs mkIf mkMerge mkForce mapAttrs mkOptionDefault mkDefault optional; + inherit (lib) genAttrs mkIf mkMerge mkForce mapAttrs mkOptionDefault mkDefault optional optionalAttrs; inherit (lib.my) mkOpt' mkBoolOpt'; inherit (lib.my.c) pubDomain; @@ -187,10 +187,10 @@ in }; }; + # TODO: Remove mutableSettings guard when Home Manager 26.11 releases; 26.05 lacks it. codex = { enable = true; package = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex; - mutableSettings = true; settings.sandbox_workspace_write.network_access = true; settings.tui = { status_line = [ @@ -206,6 +206,8 @@ in ]; status_line_use_colors = true; }; + } // optionalAttrs (options.programs.codex ? mutableSettings) { + mutableSettings = true; }; claude-code = {