Merge branch 'main' into storage-refactor
This commit is contained in:
commit
1289462220
13 changed files with 4324 additions and 52 deletions
4102
modules/common-modules/pkgs/cline/cline-package-lock.json
generated
Normal file
4102
modules/common-modules/pkgs/cline/cline-package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
53
modules/common-modules/pkgs/cline/default.nix
Normal file
53
modules/common-modules/pkgs/cline/default.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
fetchurl,
|
||||
ripgrep,
|
||||
makeWrapper,
|
||||
jq,
|
||||
...
|
||||
}:
|
||||
buildNpmPackage rec {
|
||||
pname = "cline";
|
||||
version = "2.4.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/cline/-/cline-${version}.tgz";
|
||||
hash = "sha256-2utOBC0vhoj5fR+cG+Vdo3N6+i/pNW1E4mESF/dZS/c=";
|
||||
};
|
||||
|
||||
sourceRoot = "package";
|
||||
|
||||
postPatch = ''
|
||||
cp ${./cline-package-lock.json} package-lock.json
|
||||
|
||||
# Remove @vscode/ripgrep from package.json since it tries to download
|
||||
# a binary from GitHub during install, which fails in the nix sandbox.
|
||||
# We provide ripgrep from nixpkgs instead via PATH wrapping.
|
||||
# Also remove the man field since the man page is not included in the npm tarball.
|
||||
${jq}/bin/jq 'del(.dependencies["@vscode/ripgrep"]) | del(.man)' package.json > package.json.tmp
|
||||
mv package.json.tmp package.json
|
||||
'';
|
||||
|
||||
npmDepsHash = "sha256-oHo60ghR7A4SUT0cLmIe7glPDYBK3twJ0F71RKVrxQc=";
|
||||
|
||||
dontNpmBuild = true;
|
||||
|
||||
# Skip post-install scripts to be safe
|
||||
npmFlags = ["--ignore-scripts"];
|
||||
|
||||
nativeBuildInputs = [makeWrapper jq];
|
||||
|
||||
# Provide ripgrep from nixpkgs since @vscode/ripgrep was removed
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/cline \
|
||||
--prefix PATH : ${lib.makeBinPath [ripgrep]}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more";
|
||||
homepage = "https://cline.bot";
|
||||
license = licenses.asl20;
|
||||
mainProgram = "cline";
|
||||
};
|
||||
}
|
||||
|
|
@ -44,5 +44,8 @@
|
|||
# Override h3 C library to version 4.3.0
|
||||
h3 = pkgs.callPackage ./h3-c-lib.nix {};
|
||||
})
|
||||
(final: prev: {
|
||||
cline = pkgs.callPackage ./cline/default.nix {};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,12 @@
|
|||
makeWrapper,
|
||||
jdk,
|
||||
lib,
|
||||
xorg,
|
||||
libGL,
|
||||
libx11,
|
||||
libxcursor,
|
||||
libxext,
|
||||
libxrandr,
|
||||
libxxf86vm,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
|
|
@ -24,11 +28,11 @@ stdenv.mkDerivation rec {
|
|||
runtimeDependencies = lib.makeLibraryPath [
|
||||
# glfw
|
||||
libGL
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXext
|
||||
xorg.libXrandr
|
||||
xorg.libXxf86vm
|
||||
libx11
|
||||
libxcursor
|
||||
libxext
|
||||
libxrandr
|
||||
libxxf86vm
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
|
|
|
|||
|
|
@ -10,6 +10,19 @@
|
|||
|
||||
mcp-nixos = inputs.mcp-nixos.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
|
||||
anyProfileHasInstallTool = lib.any (
|
||||
profile:
|
||||
profile.extraExtensions.claudeDev.enable
|
||||
&& profile.extraExtensions.claudeDev.installTool
|
||||
) (lib.attrValues config.programs.vscode.profiles);
|
||||
|
||||
getInstallToolPackage = lib.findFirst (package: package != null) pkgs.cline (map (
|
||||
profile:
|
||||
if profile.extraExtensions.claudeDev.enable && profile.extraExtensions.claudeDev.installTool
|
||||
then profile.extraExtensions.claudeDev.package
|
||||
else null
|
||||
) (lib.attrValues config.programs.vscode.profiles));
|
||||
|
||||
anyProfileHasMcpNixos = lib.any (
|
||||
profile:
|
||||
profile.extraExtensions.claudeDev.enable
|
||||
|
|
@ -69,6 +82,17 @@ in {
|
|||
default = ["saoudrizwan" "claude-dev"];
|
||||
};
|
||||
|
||||
installTool = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to install the cline CLI tool for subagent support when the extension is enabled";
|
||||
};
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.cline;
|
||||
description = "The package to install for the cline CLI tool";
|
||||
};
|
||||
|
||||
mcp = {
|
||||
nixos = {
|
||||
enable = lib.mkEnableOption "enable NixOS MCP server for Claude Dev";
|
||||
|
|
@ -145,6 +169,12 @@ in {
|
|||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf anyProfileHasInstallTool {
|
||||
home.packages = [
|
||||
getInstallToolPackage
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf anyProfileHasMcpNixos {
|
||||
home.packages = [
|
||||
mcp-nixos
|
||||
|
|
|
|||
|
|
@ -26,5 +26,6 @@
|
|||
./direnv.nix
|
||||
./conventionalCommits.nix
|
||||
./openDyslexicFont.nix
|
||||
./graphql.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,13 @@ in {
|
|||
extensions = [
|
||||
config.extraExtensions.go.extension
|
||||
];
|
||||
userSettings = {
|
||||
"go.alternateTools" = {
|
||||
"gopls" = "gopls";
|
||||
};
|
||||
"go.toolsManagement.autoUpdate" = false;
|
||||
"go.useLanguageServer" = true;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
|
|
|
|||
27
modules/home-manager-modules/programs/vscode/graphql.nix
Normal file
27
modules/home-manager-modules/programs/vscode/graphql.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
pkgsRepositories = pkgs.nix-vscode-extensions.forVSCodeVersion config.programs.vscode.package.version;
|
||||
pkgsRepository = pkgsRepositories.open-vsx;
|
||||
in {
|
||||
options.programs.vscode.profiles = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule ({config, ...}: {
|
||||
options = {
|
||||
extraExtensions.graphql = {
|
||||
enable = lib.mkEnableOption "should the graphql highlighting extension for vscode be enabled";
|
||||
extension = lib.mkPackageOption pkgsRepository "vscode-graphql" {
|
||||
default = ["graphql" "vscode-graphql-syntax"];
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.extraExtensions.graphql.enable {
|
||||
extensions = [
|
||||
config.extraExtensions.graphql.extension
|
||||
];
|
||||
};
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
|
@ -21,6 +21,9 @@ in {
|
|||
extensions = [
|
||||
config.extraExtensions.platformIO.extension
|
||||
];
|
||||
userSettings = {
|
||||
"platformio-ide.useBuiltinPIOCore" = false;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue