Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ab7dc5d80 | ||
|
|
622a2ae3da |
No files matched your search
@@ -25,6 +25,7 @@
|
||||
};
|
||||
ai-tools = {
|
||||
claude-code.enable = true;
|
||||
codex.enable = true;
|
||||
opencode.enable = true;
|
||||
};
|
||||
anki.enable = true;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.ai-tools.codex.enable {
|
||||
programs.codex.enable = true;
|
||||
home.packages = with pkgs; [ codex ];
|
||||
};
|
||||
}
|
||||
@@ -20,6 +20,9 @@ in
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
codex = {
|
||||
enable = lib.mkEnableOption "codex";
|
||||
};
|
||||
opencode = {
|
||||
enable = lib.mkEnableOption "opencode";
|
||||
};
|
||||
@@ -31,6 +34,7 @@ in
|
||||
imports = [
|
||||
./claude-code.nix
|
||||
./fabric.nix
|
||||
./codex.nix
|
||||
./opencode.nix
|
||||
./skills.nix
|
||||
./tirith.nix
|
||||
|
||||
@@ -2,29 +2,40 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
myUtils,
|
||||
osConfig ? null,
|
||||
inputs ? null,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.ai-tools.opencode;
|
||||
sops = myUtils.sopsAvailability config osConfig;
|
||||
standalone = osConfig == null;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
secrets.files.opencode = [ "api-key" ];
|
||||
secrets.templates."opencode/auth.json" = {
|
||||
path = ".local/share/opencode/auth.json";
|
||||
content = ''
|
||||
{
|
||||
"zai-coding-plan": {
|
||||
"type": "api",
|
||||
"key": "${config.sops.placeholder."opencode/api-key"}"
|
||||
}
|
||||
}
|
||||
'';
|
||||
config = lib.mkIf config.ai-tools.opencode.enable (
|
||||
lib.optionalAttrs standalone {
|
||||
sops = {
|
||||
secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" {
|
||||
opencode = [ "api-key" ];
|
||||
};
|
||||
templates."opencode/auth.json" = {
|
||||
path = "${config.home.homeDirectory}/.local/share/opencode/auth.json";
|
||||
content = builtins.toJSON {
|
||||
zai-coding-plan = {
|
||||
type = "api";
|
||||
key = config.sops.placeholder."opencode/api-key";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
// {
|
||||
warnings =
|
||||
lib.optional (!sops.available)
|
||||
"opencode is enabled, but sops templates are not available. the opencode API key will not be configured.";
|
||||
|
||||
home.packages = [ pkgs.opencode ];
|
||||
|
||||
home.file.".config/opencode/opencode.json".text = builtins.toJSON {
|
||||
"$schema" = "https://opencode.ai/config.json";
|
||||
permission = {
|
||||
@@ -46,5 +57,6 @@ in
|
||||
};
|
||||
plugin = [ "@mohak34/opencode-notifier@latest" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -9,7 +9,6 @@
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.taskwarrior;
|
||||
sops = myUtils.sopsAvailability config osConfig;
|
||||
standalone = osConfig == null;
|
||||
|
||||
@@ -62,7 +61,7 @@ in
|
||||
{
|
||||
options.taskwarrior.enable = lib.mkEnableOption "taskwarrior";
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
config = lib.mkIf config.taskwarrior.enable (
|
||||
lib.optionalAttrs standalone {
|
||||
sops = {
|
||||
secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" {
|
||||
|
||||
Reference in new issue
Block a user