From e74f8c427e00d825ef1f308f9b1c24f519f4c959 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 21 Jul 2024 19:08:04 -0300 Subject: [PATCH] emacsPackages.codeium: rework - set codeium explicitly instead of relying on pkgs - rename patch to a more descriptive -.patch format - use lib.getExe' instead of hardcoding the binary path - updateScript --- .../emacs/elisp-packages/manual-packages.nix | 4 +++- ...ch => 0000-set-codeium-command-executable.patch} | 0 .../manual-packages/codeium/default.nix | 13 ++++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) rename pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/{codeium.el.patch => 0000-set-codeium-command-executable.patch} (100%) diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix index 4b4abfc6f300..dc3133a811e8 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix @@ -17,7 +17,9 @@ in cask = callPackage ./manual-packages/cask { }; - codeium = callPackage ./manual-packages/codeium { }; + codeium = callPackage ./manual-packages/codeium { + inherit (pkgs) codeium; + }; consult-gh = callPackage ./manual-packages/consult-gh { }; diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/codeium.el.patch b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/0000-set-codeium-command-executable.patch similarity index 100% rename from pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/codeium.el.patch rename to pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/0000-set-codeium-command-executable.patch diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/default.nix index 344843eeabc4..59be7f543d1c 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/default.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/codeium/default.nix @@ -1,9 +1,10 @@ { + lib, + codeium, fetchFromGitHub, melpaBuild, - pkgs, - lib, substituteAll, + gitUpdater, }: melpaBuild { @@ -19,17 +20,19 @@ melpaBuild { patches = [ (substituteAll { - src = ./codeium.el.patch; - codeium = "${pkgs.codeium}/bin/codeium_language_server"; + src = ./0000-set-codeium-command-executable.patch; + codeium = lib.getExe' codeium "codeium_language_server"; }) ]; + passthru.updateScript = gitUpdater { }; + meta = { description = "Free, ultrafast Copilot alternative for Emacs"; homepage = "https://github.com/Exafunction/codeium.el"; license = lib.licenses.mit; maintainers = [ lib.maintainers.running-grass ]; - platforms = pkgs.codeium.meta.platforms; + inherit (codeium.meta) platforms; sourceProvenance = [ lib.sourceTypes.fromSource ]; };