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,40 +1,79 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.ai-tools;
rtk-version = "0.18.1";
in
{
config = {
home.packages = with pkgs; [
aider-chat
(pkgs.stdenv.mkDerivation {
name = "ccline";
src = pkgs.fetchurl {
url = "https://github.com/Haleclipse/CCometixLine/releases/download/v1.0.8/ccline-linux-x64.tar.gz";
hash = "sha256-Joe3Dd6uSMGi66QT6xr2oY/Tz8rA5RuKa6ckBVJIzI0=";
};
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
mkdir -p $out/bin
cp ccline $out/bin/
chmod +x $out/bin/ccline
'';
meta = with pkgs.lib; {
description = "CCometixLine Linux x64 CLI (Claude Code statusline)";
homepage = "https://github.com/Haleclipse/CCometixLine";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
# claude-code
# (config.lib.nixGL.wrap code-cursor)
# github-copilot-cli
mcp-nixos
opencode
];
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; [
claude-code
(pkgs.stdenv.mkDerivation {
name = "ccline";
src = pkgs.fetchurl {
url = "https://github.com/Haleclipse/CCometixLine/releases/download/v1.0.8/ccline-linux-x64.tar.gz";
hash = "sha256-Joe3Dd6uSMGi66QT6xr2oY/Tz8rA5RuKa6ckBVJIzI0=";
};
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
mkdir -p $out/bin
cp ccline $out/bin/
chmod +x $out/bin/ccline
'';
meta = with pkgs.lib; {
description = "CCometixLine Linux x64 CLI (Claude Code statusline)";
homepage = "https://github.com/Haleclipse/CCometixLine";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
(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
];
})
];
}