fix: build oraios-pywebview for serena
This commit is contained in:
+26
-2
@@ -8,7 +8,8 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
claudeCode = pkgs.callPackage "${sources.claude-code-nix}/package.nix" { };
|
claudeCode = pkgs.callPackage "${sources.claude-code-nix}/package.nix" { };
|
||||||
serena = pkgs.callPackage ./pkgs/serena/package.nix { };
|
oraios-pywebview = pkgs.callPackage ./pkgs/oraios-pywebview/package.nix { };
|
||||||
|
serena = pkgs.callPackage ./pkgs/serena/package.nix { inherit oraios-pywebview; };
|
||||||
|
|
||||||
nixosCfg = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
|
nixosCfg = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
|
||||||
inherit system;
|
inherit system;
|
||||||
@@ -30,6 +31,21 @@ let
|
|||||||
memorySize = 4096;
|
memorySize = 4096;
|
||||||
cores = 4;
|
cores = 4;
|
||||||
|
|
||||||
|
# TODO: Port-forward the serena dashboard
|
||||||
|
# forwardPorts = [
|
||||||
|
# {
|
||||||
|
# from = "guest";
|
||||||
|
# guest = {
|
||||||
|
# address = "10.0.2.15";
|
||||||
|
# port = 24282;
|
||||||
|
# };
|
||||||
|
# host = {
|
||||||
|
# address = "127.0.0.1";
|
||||||
|
# port = 24282;
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
|
||||||
sharedDirectories = {
|
sharedDirectories = {
|
||||||
workspace = {
|
workspace = {
|
||||||
source = ''"$WORKSPACE_DIR"'';
|
source = ''"$WORKSPACE_DIR"'';
|
||||||
@@ -86,7 +102,9 @@ let
|
|||||||
just
|
just
|
||||||
yaml-language-server
|
yaml-language-server
|
||||||
typescript-language-server
|
typescript-language-server
|
||||||
# fsautocomplete
|
fsautocomplete
|
||||||
|
nixd
|
||||||
|
python3
|
||||||
# sqlfluff
|
# sqlfluff
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -107,6 +125,12 @@ let
|
|||||||
# fi
|
# fi
|
||||||
|
|
||||||
cd /workspace 2>/dev/null || true
|
cd /workspace 2>/dev/null || true
|
||||||
|
|
||||||
|
# Register serena as an MCP server if not already configured
|
||||||
|
if ! claude mcp get serena &>/dev/null; then
|
||||||
|
claude mcp add serena -- ${serena}/bin/serena start-mcp-server --context=claude-code --project-from-cwd
|
||||||
|
fi
|
||||||
|
|
||||||
exec claude "''${args[@]}"
|
exec claude "''${args[@]}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
serena = pkgs.callPackage ../pkgs/serena/package.nix { };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.claude-code = {
|
|
||||||
enable = true;
|
|
||||||
mcpServers = {
|
|
||||||
serena = {
|
|
||||||
command = "${serena}/bin/serena-mcp-server";
|
|
||||||
type = "stdio";
|
|
||||||
args = [
|
|
||||||
"--context=claude-code"
|
|
||||||
"--project-from-cwd"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
python3Packages,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
|
||||||
|
python3Packages.buildPythonPackage rec {
|
||||||
|
pname = "oraios-pywebview";
|
||||||
|
version = "6.2";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "oraios";
|
||||||
|
repo = "pywebview";
|
||||||
|
tag = "v${version}";
|
||||||
|
hash = "sha256-i99O0UuyfepQHBTpeeL07TY7AbygP+/XFxX3Q8JluIU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [ python3Packages.setuptools-scm ];
|
||||||
|
|
||||||
|
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
||||||
|
|
||||||
|
dependencies = with python3Packages; [
|
||||||
|
bottle
|
||||||
|
pyside6
|
||||||
|
proxy-tools
|
||||||
|
qtpy
|
||||||
|
six
|
||||||
|
typing-extensions
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "webview" ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Lightweight cross-platform wrapper around a webview (oraios fork)";
|
||||||
|
homepage = "https://github.com/oraios/pywebview";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
pyright,
|
pyright,
|
||||||
fortls,
|
fortls,
|
||||||
|
oraios-pywebview,
|
||||||
}:
|
}:
|
||||||
# TODO: We can just get this from nixpkgs when merged: https://github.com/NixOS/nixpkgs/pull/506300
|
# TODO: We can just get this from nixpkgs when merged: https://github.com/NixOS/nixpkgs/pull/506300
|
||||||
python3Packages.buildPythonApplication (finalAttrs: {
|
python3Packages.buildPythonApplication (finalAttrs: {
|
||||||
@@ -33,10 +34,6 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
|||||||
# Remove fortls from Python dependencies and make it available at runtime instead
|
# Remove fortls from Python dependencies and make it available at runtime instead
|
||||||
substituteInPlace pyproject.toml \
|
substituteInPlace pyproject.toml \
|
||||||
--replace-fail '"fortls==3.2.2",' ""
|
--replace-fail '"fortls==3.2.2",' ""
|
||||||
|
|
||||||
# Remove oraios-pywebview (custom fork, not in nixpkgs; only needed for GUI features)
|
|
||||||
substituteInPlace pyproject.toml \
|
|
||||||
--replace-fail '"oraios-pywebview==6.2",' ""
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
build-system = [ python3Packages.hatchling ];
|
build-system = [ python3Packages.hatchling ];
|
||||||
@@ -47,7 +44,9 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
|||||||
"--prefix PATH : ${lib.makeBinPath [ pyright fortls ]}"
|
"--prefix PATH : ${lib.makeBinPath [ pyright fortls ]}"
|
||||||
];
|
];
|
||||||
|
|
||||||
dependencies = with python3Packages; [
|
dependencies = [
|
||||||
|
oraios-pywebview
|
||||||
|
] ++ (with python3Packages; [
|
||||||
anthropic
|
anthropic
|
||||||
docstring-parser
|
docstring-parser
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
@@ -69,7 +68,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
|||||||
tiktoken
|
tiktoken
|
||||||
tqdm
|
tqdm
|
||||||
types-pyyaml
|
types-pyyaml
|
||||||
];
|
]);
|
||||||
|
|
||||||
optional-dependencies = with python3Packages; {
|
optional-dependencies = with python3Packages; {
|
||||||
google = [ google-genai ];
|
google = [ google-genai ];
|
||||||
|
|||||||
Reference in New Issue
Block a user