1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/modules/programs/opencode.nix
Austin Horstman 7c78e592a8 maintainers: remove duplicate nixpkgs maintainers
We don't need to maintain them in here, removing them to fix CI check

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-17 15:15:39 -05:00

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;
};
};
}