diff --git a/tests/modules/programs/gemini-cli/my-rules.toml b/tests/modules/programs/gemini-cli/my-rules.toml new file mode 100644 index 00000000..0d8b2ad9 --- /dev/null +++ b/tests/modules/programs/gemini-cli/my-rules.toml @@ -0,0 +1,5 @@ +[[rule]] +commandPrefix = "git " +decision = "ask_user" +priority = 100 +toolName = "run_shell_command" diff --git a/tests/modules/programs/gemini-cli/other-rules.toml b/tests/modules/programs/gemini-cli/other-rules.toml new file mode 100644 index 00000000..30b1911d --- /dev/null +++ b/tests/modules/programs/gemini-cli/other-rules.toml @@ -0,0 +1,4 @@ +[[rule]] +toolName = "read_file" +decision = "allow" +priority = 50 diff --git a/tests/modules/programs/gemini-cli/settings.nix b/tests/modules/programs/gemini-cli/settings.nix index 80a4344a..92ced6b9 100644 --- a/tests/modules/programs/gemini-cli/settings.nix +++ b/tests/modules/programs/gemini-cli/settings.nix @@ -20,6 +20,19 @@ description = "Generates a fix for a given GitHub issue."; }; }; + policies = { + "my-rules" = { + rule = [ + { + toolName = "run_shell_command"; + commandPrefix = "git "; + decision = "ask_user"; + priority = 100; + } + ]; + }; + "other-rules" = ./other-rules.toml; + }; }; nmt.script = '' assertFileExists home-files/.gemini/settings.json @@ -29,6 +42,10 @@ ${./changelog.toml} assertFileContent home-files/.gemini/commands/git/fix.toml \ ${./fix.toml} + assertFileContent home-files/.gemini/policies/my-rules.toml \ + ${./my-rules.toml} + assertFileContent home-files/.gemini/policies/other-rules.toml \ + ${./other-rules.toml} assertFileExists home-path/etc/profile.d/hm-session-vars.sh assertFileContains home-path/etc/profile.d/hm-session-vars.sh \