{inputs, ...}: { # This one brings our custom packages from the 'pkgs' directory # additions = final: prev: # (import ../pkgs {pkgs = final;}) # // { # zugferd-service = inputs.zugferd-service.packages.${prev.stdenv.hostPlatform.system}.default; # }; # This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really. # https://nixos.wiki/wiki/Overlays modifications = final: prev: { # nixpkgs-unstable regression: v4l2loopback 0.15.4 ships depmod-generated # module maps that collide in pkgs.aggregateModules and break the NixOS # toplevel build. See overlays/mods/v4l2loopback.nix for details. inherit (import ./mods/v4l2loopback.nix {inherit prev;}) linuxPackages linuxPackages_latest ; inherit (import ./mods/khal.nix {inherit prev;}) khal; # n8n = import ./mods/n8n.nix {inherit prev;}; # font-manager = import ./mods/font-manager.nix {inherit prev;}; # opencode: use the llm-agents.nix build (tracks that flake's version) # instead of the nixpkgs pin, which lags behind. # opencode = final.llm-agents.opencode; # opencode-desktop = final.llm-agents.opencode; vivaldi = prev.vivaldi.override { commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; }; # example = prev.example.overrideAttrs (oldAttrs: rec { # ... # }); }; stable-packages = final: _prev: { stable = import inputs.nixpkgs-stable { system = final.stdenv.hostPlatform.system; config.allowUnfree = true; }; }; # Local fixes on top of numtide/llm-agents.nix. Must be applied AFTER # inputs.llm-agents.overlays.shared-nixpkgs (see hosts/common/default.nix) # so `prev.llm-agents` exists — overlays listed earlier would be shadowed # by the shared-nixpkgs overlay re-setting the `llm-agents` attribute. llm-agents-overrides = final: prev: let system = final.stdenv.hostPlatform.system; # llm-agents packages resolve their arguments (e.g. postgresql_18 for # paperclip) against OUR nixpkgs via shared-nixpkgs; our current pin # predates postgresql_18. Take it from llm-agents' own nixpkgs input, # which is what upstream builds and tests against. postgresql_18 = inputs.llm-agents.inputs.nixpkgs.legacyPackages.${system}.postgresql_18; in { inherit postgresql_18; llm-agents = prev.llm-agents or {} // { # paperclip 2026.916.1: upstream postInstall patches only the FIRST # embedded-postgres/dist/binary.js (find -print -quit). The package # ships two copies (hoisted + nested under @paperclipai/db); the # runtime-resolved hoisted one kept importing the deleted # @embedded-postgres/linux-x64 → ERR_MODULE_NOT_FOUND at server # start (and its index.js missed the unix-socket-dir fix, which # would have failed next on /run/postgresql). Patch every copy. # Drop this override once numtide/llm-agents.nix fixes postInstall. paperclip = prev.llm-agents.paperclip.overrideAttrs (old: { postInstall = '' while IFS= read -r embedded; do cat > "$embedded" <<'EOF' function getBinaries() { return Promise.resolve({ postgres: "${postgresql_18}/bin/postgres", initdb: "${postgresql_18}/bin/initdb", pg_ctl: "${postgresql_18}/bin/pg_ctl", }); } export default getBinaries; EOF # nixpkgs PostgreSQL defaults its unix socket to # /run/postgresql, which unprivileged users cannot # write to. Keep the socket in the data dir. substituteInPlace "$(dirname "$embedded")/index.js" \ --replace-fail "...this.options.postgresFlags," \ "'-k', this.options.databaseDir, ...this.options.postgresFlags," done < <(find "$out/lib/node_modules" -path '*/embedded-postgres/dist/binary.js' -type f) # Drop the now unused FHS-linked binaries. while IFS= read -r scope; do find "$scope" -mindepth 1 -maxdepth 1 ! -name symlink-reader -exec rm -rf {} + done < <(find "$out/lib/node_modules" -path '*/node_modules/@embedded-postgres' -type d) ''; }); }; }; # mkLlmAgentsOverlay = system: _final: _prev: # removeAttrs (inputs.llm-agents.packages.${system} or {}) [ # # Internal helpers from packages/* marked hideFromDocs upstream: # "antigravity" # "auto-claude" # "buildNpmPackage" # ← the culprit; breaks webcord's `buildNpmPackage.override { nodejs = ...; }` # "bun2nix" # "darwinOpenptyHook" # "default" # fzf launcher; collides with nothing in nixpkgs but kept out for hygiene # "dolt" # collides with nixpkgs.dolt (Dolt database); not used in this config # "flake-inputs" # "forge" # "formatelf" # "formatter" # collides conceptually with pkgs.formatter; not used here # "go-bin" # "unpinCargoMsrvHook" # "unpinGoModVersionHook" # "versionCheckHomeHook" # "wrapBuddy" # ]; }