mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
We don't need to maintain them in here, removing them to fix CI check Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib)
|
|
literalExpression
|
|
mkEnableOption
|
|
mkIf
|
|
mkOption
|
|
mkPackageOption
|
|
;
|
|
|
|
cfg = config.programs.opencode;
|
|
|
|
jsonFormat = pkgs.formats.json { };
|
|
in
|
|
{
|
|
meta.maintainers = with lib.maintainers; [ delafthi ];
|
|
|
|
options.programs.opencode = {
|
|
enable = mkEnableOption "opencode";
|
|
|
|
package = mkPackageOption pkgs "opencode" { nullable = true; };
|
|
|
|
settings = mkOption {
|
|
inherit (jsonFormat) type;
|
|
default = { };
|
|
example = literalExpression ''
|
|
{
|
|
theme = "opencode";
|
|
model = "anthropic/claude-sonnet-4-20250514";
|
|
autoshare = false;
|
|
autoupdate = true;
|
|
}
|
|
'';
|
|
description = ''
|
|
Configuration written to {file}`$XDG_CONFIG_HOME/opencode/config.json`.
|
|
See <https://opencode.ai/docs/config/> for the documentation.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."opencode/config.json" = mkIf (cfg.settings != { }) {
|
|
source = jsonFormat.generate "config.json" cfg.settings;
|
|
};
|
|
};
|
|
}
|