From 85942195f418b52ffe43efd984c6a6eb6971ad7b Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sun, 9 Mar 2025 15:27:49 -0700 Subject: [PATCH 1/2] add copilot extension and flake update --- flake.lock | 32 ++++++++++++++++---------------- flake.nix | 2 +- home.nix | 4 ++++ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index a08fdf7..2ade29b 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1740845322, - "narHash": "sha256-AXEgFj3C0YJhu9k1OhbRhiA6FnDr81dQZ65U3DhaWpw=", + "lastModified": 1741543064, + "narHash": "sha256-AjXyS3ACxWAd+h3NSkrflN+uC0Tq1XFqox472RF6yh0=", "owner": "nix-community", "repo": "home-manager", - "rev": "fcac3d6d88302a5e64f6cb8014ac785e08874c8d", + "rev": "db4386d686fb0b2788e7422e6a2299deace9c4b1", "type": "github" }, "original": { @@ -48,11 +48,11 @@ ] }, "locked": { - "lastModified": 1740755725, - "narHash": "sha256-amZbqP84H/ApugaT+TADXTB3NbjkVHI9Vac1saIk0kE=", + "lastModified": 1741229100, + "narHash": "sha256-0HwrTDXp9buEwal/1ymK9uQmzUD5ozIA7CJGqnT/gLs=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "5d6e0851b60508cffd66b4a6982440a40720338d", + "rev": "adf5c88ba1fe21af5c083b4d655004431f20c5ab", "type": "github" }, "original": { @@ -63,27 +63,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740828860, - "narHash": "sha256-cjbHI+zUzK5CPsQZqMhE3npTyYFt9tJ3+ohcfaOF/WM=", + "lastModified": 1741402956, + "narHash": "sha256-y2hByvBM03s9T2fpeLjW6iprbxnhV9mJMmSwCHc41ZQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "303bd8071377433a2d8f76e684ec773d70c5b642", + "rev": "ed0b1881565c1ffef490c10d663d4f542031dad3", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1740828860, - "narHash": "sha256-cjbHI+zUzK5CPsQZqMhE3npTyYFt9tJ3+ohcfaOF/WM=", + "lastModified": 1741379970, + "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "303bd8071377433a2d8f76e684ec773d70c5b642", + "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", "type": "github" }, "original": { @@ -100,11 +100,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1740968044, - "narHash": "sha256-nvDJeg1CZHl5LfzSjF0fg4vN43yWi11g0l+fqCPrPsY=", + "lastModified": 1741560307, + "narHash": "sha256-sS25HPoonksGtSmQsOyMVESYLDxxUZVmEQGPGlHWHIk=", "owner": "nix-community", "repo": "nur", - "rev": "27c215df50e54f048a03616eb9fc20190e5d71f5", + "rev": "4ae43b04c54350575c1e0fd6ee1547629b2e06ff", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a091a72..63506ba 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Nix and home-manager configurations for Softinio's macbook"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nix-darwin = { url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home.nix b/home.nix index e478067..715a86d 100644 --- a/home.nix +++ b/home.nix @@ -14,6 +14,7 @@ pkg: builtins.elem (lib.getName pkg) [ "discord" + "gh-copilot" "slack" "vscode" "vscode-extension-github-copilot" @@ -151,6 +152,9 @@ programs.gh = { enable = true; + extensions = [ + pkgs.gh-copilot + ]; settings = { editor = "nvim"; git_protocol = "ssh"; -- 2.48.1 From 8a8c9597bb6ff791b1fb9f671d4df0075057cb7e Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sun, 9 Mar 2025 16:11:03 -0700 Subject: [PATCH 2/2] remove aider derivation as no longer needed --- programs/aider/aider-deriv.nix | 204 --------------------------------- programs/aider/default.nix | 7 +- 2 files changed, 3 insertions(+), 208 deletions(-) delete mode 100644 programs/aider/aider-deriv.nix diff --git a/programs/aider/aider-deriv.nix b/programs/aider/aider-deriv.nix deleted file mode 100644 index 5369648..0000000 --- a/programs/aider/aider-deriv.nix +++ /dev/null @@ -1,204 +0,0 @@ -{ lib, pkgs, ... }: -let - python3 = pkgs.python312.override { - self = python3; - packageOverrides = _: super: { tree-sitter = super.tree-sitter_0_21; }; - }; - version = "0.74.1"; - aider-chat = python3.pkgs.buildPythonPackage { - pname = "aider-chat"; - inherit version; - pyproject = true; - - src = pkgs.fetchFromGitHub { - owner = "Aider-AI"; - repo = "aider"; - tag = "v${version}"; - hash = "sha256-JXzkvuSOOEUxNqF6l5USzIPftpnIW+CptEv/0yp0eGM="; - }; - - pythonRelaxDeps = true; - - build-system = with python3.pkgs; [ setuptools-scm ]; - - dependencies = with python3.pkgs; [ - aiohappyeyeballs - aiohttp - aiosignal - annotated-types - anyio - attrs - backoff - beautifulsoup4 - certifi - cffi - charset-normalizer - click - configargparse - diff-match-patch - diskcache - distro - filelock - flake8 - frozenlist - fsspec - gitdb - gitpython - grep-ast - h11 - httpcore - httpx - huggingface-hub - idna - importlib-resources - jinja2 - jiter - json5 - jsonschema - jsonschema-specifications - litellm - markdown-it-py - markupsafe - mccabe - mdurl - multidict - networkx - numpy - openai - packaging - pathspec - pexpect - pillow - prompt-toolkit - psutil - ptyprocess - pycodestyle - pycparser - pydantic - pydantic-core - pydub - pyflakes - pygments - pypandoc - pyperclip - python-dotenv - pyyaml - referencing - regex - requests - rich - rpds-py - scipy - smmap - sniffio - sounddevice - soundfile - soupsieve - tiktoken - tokenizers - tqdm - tree-sitter - tree-sitter-languages - typing-extensions - urllib3 - watchfiles - wcwidth - yarl - zipp - pip - - # Not listed in requirements - mixpanel - monotonic - posthog - propcache - python-dateutil - ]; - - buildInputs = [ pkgs.portaudio ]; - - nativeCheckInputs = (with python3.pkgs; [ pytestCheckHook ]) ++ [ pkgs.gitMinimal ]; - - disabledTestPaths = [ - # Tests require network access - "tests/scrape/test_scrape.py" - # Expected 'mock' to have been called once - "tests/help/test_help.py" - ]; - - disabledTests = - [ - # Tests require network - "test_urls" - "test_get_commit_message_with_custom_prompt" - # FileNotFoundError - "test_get_commit_message" - # Expected 'launch_gui' to have been called once - "test_browser_flag_imports_streamlit" - # AttributeError - "test_simple_send_with_retries" - # Expected 'check_version' to have been called once - "test_main_exit_calls_version_check" - # AssertionError: assert 2 == 1 - "test_simple_send_non_retryable_error" - ] - ++ lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ - # Tests fails on darwin - "test_dark_mode_sets_code_theme" - "test_default_env_file_sets_automatic_variable" - # FileNotFoundError: [Errno 2] No such file or directory: 'vim' - "test_pipe_editor" - ]; - - makeWrapperArgs = [ - "--set AIDER_CHECK_UPDATE false" - "--set AIDER_ANALYTICS false" - ]; - - preCheck = '' - export HOME=$(mktemp -d) - export AIDER_ANALYTICS="false" - ''; - - optional-dependencies = with python3.pkgs; { - playwright = [ - greenlet - playwright - pyee - typing-extensions - ]; - }; - - passthru = { - withPlaywright = aider-chat.overridePythonAttrs ( - { - dependencies, - buildInputs, - makeWrapperArgs, - ... - }: - { - - dependencies = dependencies ++ aider-chat.optional-dependencies.playwright; - - buildInputs = buildInputs ++ [ pkgs.playwright-driver.browsers ]; - - makeWrapperArgs = makeWrapperArgs ++ [ - "--set PLAYWRIGHT_BROWSERS_PATH ${pkgs.playwright-driver.browsers}" - "--set PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true" - ]; - } - ); - }; - - meta = { - description = "AI pair programming in your terminal"; - homepage = "https://github.com/paul-gauthier/aider"; - changelog = "https://github.com/paul-gauthier/aider/blob/v${version}/HISTORY.md"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ happysalada ]; - mainProgram = "aider"; - }; - }; -in -aider-chat diff --git a/programs/aider/default.nix b/programs/aider/default.nix index 89c22c1..7a30917 100644 --- a/programs/aider/default.nix +++ b/programs/aider/default.nix @@ -1,12 +1,11 @@ -{ lib, pkgs, ... }: +{ pkgs, ... }: let aiderConfig = builtins.readFile ./aider.yml; - aiderPkgs = import ./aider-deriv.nix { inherit lib pkgs; }; in { - home.packages = [ - aiderPkgs.withPlaywright + home.packages = with pkgs; [ + aider-chat.withPlaywright ]; home.file.".aider.conf.yml".text = aiderConfig; } -- 2.48.1