fix: improve 'ai-tools' module (host-specific options)
This commit is contained in:
@@ -40,6 +40,7 @@ in
|
|||||||
xdg.userDirs.createDirectories = false;
|
xdg.userDirs.createDirectories = false;
|
||||||
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
||||||
|
|
||||||
|
ai-tools.opencode.enable = true;
|
||||||
browser.primary = "librewolf";
|
browser.primary = "librewolf";
|
||||||
cloud.hetzner.enable = true;
|
cloud.hetzner.enable = true;
|
||||||
comms.signal.enable = true;
|
comms.signal.enable = true;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ in
|
|||||||
xdg.userDirs.createDirectories = false;
|
xdg.userDirs.createDirectories = false;
|
||||||
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
||||||
|
|
||||||
|
ai-tools.opencode.enable = true;
|
||||||
browser.primary = "librewolf";
|
browser.primary = "librewolf";
|
||||||
cloud.hetzner.enable = true;
|
cloud.hetzner.enable = true;
|
||||||
comms.signal.enable = true;
|
comms.signal.enable = true;
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ in
|
|||||||
cloud.azure.enable = true;
|
cloud.azure.enable = true;
|
||||||
comms.signal.enable = true;
|
comms.signal.enable = true;
|
||||||
comms.teams.enable = true;
|
comms.teams.enable = true;
|
||||||
|
ai-tools.claude-code.enable = true;
|
||||||
github.enable = true;
|
github.enable = true;
|
||||||
gitlab.enable = true;
|
gitlab.enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +1,79 @@
|
|||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.ai-tools;
|
||||||
|
rtk-version = "0.18.1";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config = {
|
options.ai-tools = {
|
||||||
home.packages = with pkgs; [
|
claude-code.enable = lib.mkEnableOption "claude code with rtk and ccline";
|
||||||
aider-chat
|
opencode.enable = lib.mkEnableOption "opencode";
|
||||||
(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
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user