fix: improve 'ai-tools' module (host-specific options)

This commit is contained in:
2026-02-16 17:56:54 +01:00
parent 092a4b47e6
commit a846849a80
4 changed files with 75 additions and 33 deletions

View File

@@ -40,6 +40,7 @@ in
xdg.userDirs.createDirectories = false;
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
ai-tools.opencode.enable = true;
browser.primary = "librewolf";
cloud.hetzner.enable = true;
comms.signal.enable = true;

View File

@@ -37,6 +37,7 @@ in
xdg.userDirs.createDirectories = false;
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
ai-tools.opencode.enable = true;
browser.primary = "librewolf";
cloud.hetzner.enable = true;
comms.signal.enable = true;

View File

@@ -70,6 +70,7 @@ in
cloud.azure.enable = true;
comms.signal.enable = true;
comms.teams.enable = true;
ai-tools.claude-code.enable = true;
github.enable = true;
gitlab.enable = true;

View File

@@ -1,11 +1,23 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.ai-tools;
rtk-version = "0.18.1";
in
{
config = {
options.ai-tools = {
claude-code.enable = lib.mkEnableOption "claude code with rtk and ccline";
opencode.enable = lib.mkEnableOption "opencode";
};
config = lib.mkMerge [
(lib.mkIf cfg.claude-code.enable {
home.packages = with pkgs; [
aider-chat
claude-code
(pkgs.stdenv.mkDerivation {
name = "ccline";
src = pkgs.fetchurl {
@@ -30,11 +42,38 @@
platforms = [ "x86_64-linux" ];
};
})
# claude-code
# (config.lib.nixGL.wrap code-cursor)
# github-copilot-cli
(pkgs.stdenv.mkDerivation {
name = "rtk-${rtk-version}";
version = rtk-version;
src = pkgs.fetchurl {
url = "https://github.com/rtk-ai/rtk/releases/download/v${rtk-version}/rtk-x86_64-unknown-linux-gnu.tar.gz";
hash = "sha256-XoTia5K8b00OzcKYCufwx8ApkAS31DxUCpGSU0jFs2Q=";
};
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
mkdir -p $out/bin
cp rtk $out/bin/
chmod +x $out/bin/rtk
'';
meta = with pkgs.lib; {
description = "RTK - AI coding tool enhancer";
homepage = "https://www.rtk-ai.app";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
mcp-nixos
];
})
(lib.mkIf cfg.opencode.enable {
home.packages = with pkgs; [
opencode
];
};
})
];
}