mirror of
https://github.com/nix-community/home-manager.git
synced 2026-12-06 04:40:17 +00:00
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.
28 lines
894 B
Nix
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
|
|
'';
|
|
}
|