updates / experimental TC setup

This commit is contained in:
2026-10-24 10:44:58 +02:00
parent 3c25fc5d41
commit d36b281a4d
48 changed files with 1147 additions and 718 deletions
+92 -21
View File
@@ -10,8 +10,23 @@
# 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;};
# 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";
};
@@ -26,24 +41,80 @@
config.allowUnfree = true;
};
};
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"
];
# 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"
# ];
}
+26
View File
@@ -0,0 +1,26 @@
# nixpkgs-unstable regression fix (seen on 26.11.20261020.5adc508):
#
# khal sets `sphinxBuilders = [ "html" "man" ]`, but sphinx-hook.sh reads
# it as a plain string:
#
# eval "__sphinxBuilders=($sphinxBuilders)"
#
# With __structuredAttrs (the default in this unstable snapshot) the list
# arrives in the builder as a bash ARRAY, and `$sphinxBuilders` expands to
# only its first element ("html"). The man builder never runs and the
# build fails with:
#
# error: builder for '…-khal-0.14.1.drv' failed to produce output path
# for output 'man' at "…-khal-0.14.1-man"
#
# Passing the builders as a space-separated string restores the hook's
# expected input format.
#
# Drop this overlay once nixpkgs' sphinx-hook.sh handles array-valued
# sphinxBuilders under structured attrs (then remove the wiring in
# overlays/default.nix).
{prev}: {
khal = prev.khal.overrideAttrs (old: {
sphinxBuilders = "html man";
});
}
+49
View File
@@ -0,0 +1,49 @@
# nixpkgs-unstable regression fix (seen on 26.11.20261020.5adc508):
#
# v4l2loopback 0.15.4 delegates `modules_install` to the kernel build
# system (`make -C $KERNEL_DIR M=$PWD modules_install`), and the kernel's
# modinst machinery runs `depmod -b $out` on its own. The nixpkgs
# expression's guard `sed -i '/depmod/d' Makefile` only strips
# v4l2loopback's OWN depmod call, so the output ships depmod-generated
# module maps (modules.alias, modules.dep, …) next to the module.
#
# Those maps collide with the kernel's own maps in pkgs.aggregateModules
# (kmod/aggregator.nix), which is a buildEnv without ignoreCollisions and
# regenerates all maps itself after merging:
#
# pkgs.buildEnv error: two given paths contain a conflicting subpath:
# `…-v4l2loopback-0.15.4/lib/modules/7.3.0/modules.alias` and
# `…-linux-7.3-modules/lib/modules/7.3.0/modules.alias`
#
# Strip the generated maps from the module output; the actual module
# (updates/*.ko*) and its kmodigest certificate (*.ko.cer) stay untouched.
#
# Applied per kernel-package alias (boot.kernelPackages.<set>) because
# top-level `linuxPackagesFor` is bypassed by the linuxKernel aliases.
#
# Drop this overlay once nixpkgs' v4l2loopback suppresses the kernel-side
# depmod again (then remove the wiring in overlays/default.nix).
{prev}: let
inherit (prev) lib;
stripDepmodMaps = old: {
postInstall =
(old.postInstall or "")
+ ''
# Remove depmod-generated maps; aggregateModules regenerates them.
rm -f $out/lib/modules/*/modules.*
'';
};
fixSet = lp:
lp.extend (
_self: super:
lib.optionalAttrs (super ? v4l2loopback) {
v4l2loopback = super.v4l2loopback.overrideAttrs stripDepmodMaps;
}
);
in {
linuxPackages = fixSet prev.linuxPackages;
linuxPackages_latest = fixSet prev.linuxPackages_latest;
}