feat(opencode): pin top-level opencode to v2 from llm-agents

- new ai-agents overlay (applied after m3ta-nixpkgs, which re-exports
  opencode-desktop from its own older v1 flake input):
  * opencode -> llm-agents.opencode2 (2.0.16), binary renamed back to
    'opencode' so keybinds/wrappers keep working
  * opencode-desktop -> llm-agents.opencode-desktop (1.18.32, newest
    existing desktop release; no v2 desktop app upstream)
- bump llm-agents lock to 8bec0ce1 (opencode2 2.0.16)
- m3-hermes keeps llm-agents.opencode (v1) for now
This commit is contained in:
m3ta-chiron committed 2026-09-24 12:58:42 +02:00
1 parent 8f5f3754e5
commit 839697e21c
4 files changed
+343 -208

No files matched your search

+37 -1
View File
@@ -15,7 +15,43 @@
# font-manager 0.9.4 does not compile against gtk4 4.22 (Vala errors
# in Gtk.DragIcon.get_for_drag) — apply the upstream fix from
# FontManager/font-manager#468 until our nixpkgs lock carries it.
font-manager = import ./mods/font-manager.nix {inherit prev;};
# font-manager = import ./mods/font-manager.nix {inherit prev;};
# rofi-pass{,-wayland} were removed from nixpkgs on 2026-09-04
# ("unmaintained upstream"). m3ta-home's rofi module and the Hyprland
# mod+P keybind still use them — resurrect via overlay until a
# maintained replacement is packaged upstream.
rofi-pass = final.callPackage ./mods/rofi-pass.nix {};
rofi-pass-wayland = final.callPackage ./mods/rofi-pass.nix {backend = "wayland";};
};
# Top-level pins for the OpenCode packages from llm-agents. Applied
# AFTER m3ta-nixpkgs' overlay in hosts/common/default.nix — that overlay
# re-exports `opencode-desktop` from its own `opencode` flake input
# (github:anomalyco/opencode, v1 line), which would clobber a pin placed
# in `modifications`.
ai-agents = final: _prev: {
# OpenCode TUI: nixpkgs' top-level `opencode` still tracks the v1 line
# (1.18.x) and llm-agents' shared-nixpkgs overlay namespaces everything
# under `pkgs.llm-agents.*` by design. Expose the v2 CLI (npm
# @opencode/cli latest) under the canonical top-level attribute so
# home-manager's programs.opencode and m3ta-home pick it up. Upstream
# installs the binary as `opencode2` (so v1/v2 can coexist in the
# llm-agents package set) — rename it back to `opencode` to keep
# keybinds, aliases, and wrappers working.
opencode = final.symlinkJoin {
name = "opencode-${final.llm-agents.opencode2.version}";
paths = [final.llm-agents.opencode2];
postBuild = ''
mv $out/bin/opencode2 $out/bin/opencode
'';
meta = (final.llm-agents.opencode2.meta or {}) // {mainProgram = "opencode";};
};
# OpenCode Desktop: no v2 desktop app exists upstream (anomalyco/opencode
# ends at v1.18.32); track the newest v1 release from llm-agents instead
# of the older m3ta-nixpkgs pin (1.18.30+95daf90).
opencode-desktop = final.llm-agents.opencode-desktop;
};
# temp-packages = final: _prev: {
+109
View File
@@ -0,0 +1,109 @@
# Resurrected from nixpkgs after upstream removal on 2026-09-04
# ("rofi-pass has been removed as it is unmaintained upstream").
# m3ta-home's rofi module (programs.rofi.pass.package) and the Hyprland
# mod+P keybind still rely on it. Pinned resurrection — no updateScript.
{
lib,
stdenv,
fetchFromGitHub,
makeBinaryWrapper,
coreutils,
util-linuxMinimal,
gnugrep,
libnotify,
pwgen,
findutils,
gawk,
gnused,
rofi,
# wayland-only deps
pass-wayland,
wl-clipboard,
wtype,
# x11-only deps
pass,
xclip,
xdotool,
# backend selector
backend ? "x11",
}:
assert lib.assertOneOf "backend" backend [
"x11"
"wayland"
];
stdenv.mkDerivation {
pname = "rofi-pass";
version = "2.0.2-unstable-2024-06-16";
src = fetchFromGitHub {
owner = "carnager";
repo = "rofi-pass";
rev = "37c4c862deb133a85b7d72989acfdbd2ef16b8ad";
hash = "sha256-1lPNj47vTPLBK7mVm+PngV8C/ZsjJ2EN4ffXGU2TlQo=";
};
nativeBuildInputs = [makeBinaryWrapper];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -a rofi-pass $out/bin/rofi-pass
mkdir -p $out/share/doc/rofi-pass/
cp -a config.example $out/share/doc/rofi-pass/config.example
runHook postInstall
'';
wrapperPath = lib.makeBinPath (
[
coreutils
findutils
gawk
gnugrep
gnused
libnotify
pwgen
rofi
util-linuxMinimal
]
++ lib.optionals (backend == "x11") [
(pass.withExtensions (ext: [ext.pass-otp]))
xclip
xdotool
]
++ lib.optionals (backend == "wayland") [
(pass-wayland.withExtensions (ext: [ext.pass-otp]))
wl-clipboard
wtype
]
);
fixupPhase = ''
runHook preFixup
patchShebangs $out/bin
wrapProgram $out/bin/rofi-pass \
--prefix PATH : "$wrapperPath" \
--set-default ROFI_PASS_BACKEND ${if backend == "wayland" then "wtype" else "xdotool"} \
--set-default ROFI_PASS_CLIPBOARD_BACKEND ${
if backend == "wayland" then "wl-clipboard" else "xclip"
}
runHook postFixup
'';
meta = {
description = "Script to make rofi work with password-store";
mainProgram = "rofi-pass";
homepage = "https://github.com/carnager/rofi-pass";
license = lib.licenses.gpl3;
platforms = with lib.platforms; linux;
};
}