Files
home-manager/tests/modules/programs/opencode/layer-empty.nix
Austin Horstman 8de9cb9d5d opencode: add layers for mutable configuration
Use the upstream config selectors to load declarative settings without
linking the application-written files. Select the effective installed
paths consistently for sessions and the web service.
2026-10-13 20:07:57 -05:00

28 lines
894 B
Nix

{ config, ... }:
{
programs.opencode = {
enable = true;
mutableSettings = true;
package = null;
settings = { };
tui = { };
};
assertions = [
{
assertion = !(config.home.sessionVariables ? OPENCODE_CONFIG);
message = "OpenCode must export a settings selector only for an enabled nonempty layer.";
}
{
assertion = !(config.home.sessionVariables ? OPENCODE_TUI_CONFIG);
message = "OpenCode must export a TUI selector only for an enabled nonempty layer.";
}
];
nmt.script = ''
assertPathNotExists "home-files/.config/opencode/home-manager.json"
assertPathNotExists "home-files/.config/opencode/home-manager-tui.json"
assertPathNotExists "home-files/.config/opencode/opencode.json"
assertPathNotExists "home-files/.config/opencode/tui.json"
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
'';
}