diff --git a/overlays/default.nix b/overlays/default.nix index 417e222..ce16870 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,76 +1 @@ -# Nixpkgs overlay for commonscomputing -# -# Overlays modify the global pkgs set. Anything that references -# `pkgs.` (including NixOS service modules using `mkPackageOption`) -# automatically picks up our overrides without further config changes. -# -# Each override below should include a brief note about why we're overriding -# and when the override can be removed (e.g. when nixpkgs catches up). - -final: prev: { - # Override bluesky-pds to v0.4.219 (latest tag in bluesky-social/pds repo). - # - # As of 2026-04-26 nixpkgs-unstable ships 0.4.204. The deployed version on - # z-space (from our pinned flake.lock) is even older at 0.4.182. - # - # Notable changes between 0.4.182 and 0.4.219: - # - Default PDS_BLOB_UPLOAD_LIMIT doubled to 100 MB (commit cc0e9ac) - # - Rate limits enabled by default (PR #308) - # - Node bumped to v20.20 (commit 0ef7817) - # - pdsadmin account commands replaced with goat (PR #313) - # - # Remove this override once nixpkgs ships bluesky-pds >= 0.4.219. - bluesky-pds = prev.bluesky-pds.overrideAttrs (old: rec { - version = "0.4.219"; - - src = prev.fetchFromGitHub { - owner = "bluesky-social"; - repo = "pds"; - tag = "v${version}"; - hash = "sha256-zXNg1rtXN9qdTBvRlSiPlRu6k1Pv3T8nhROsEarev5U="; - }; - - sourceRoot = "${src.name}/service"; - patches = []; - nativeBuildInputs = - (builtins.filter (pkg: !(builtins.elem (pkg.pname or "") [ "nodejs" "pnpm" ])) old.nativeBuildInputs) - ++ [ prev.nodejs_22 prev.pnpm_9 ]; - - buildPhase = '' - runHook preBuild - - pushd ./node_modules/.pnpm/better-sqlite3@*/node_modules/better-sqlite3 - npm run build-release --offline --nodedir="${prev.srcOnly prev.nodejs_22}" - find build -type f -exec remove-references-to -t "${prev.srcOnly prev.nodejs_22}" {} \; - popd - - makeWrapper "${prev.nodejs_22}/bin/node" "$out/bin/pds" \ - --add-flags --enable-source-maps \ - --add-flags "$out/lib/pds/index.js" \ - --set-default NODE_ENV production - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out/{bin,lib/pds} - mv node_modules $out/lib/pds - mv index.js $out/lib/pds - - runHook postInstall - ''; - - # pnpmDeps must be re-fetched whenever src changes because pnpm-lock.yaml - # may have changed. The hash below was computed by running a build with - # an empty hash and reading the correct one from the build failure. - pnpmDeps = prev.fetchPnpmDeps { - pname = "pds"; - inherit version src sourceRoot; - pnpm = prev.pnpm_9; - fetcherVersion = 3; - hash = "sha256-rZpimxX4oDXIaUdAkkNPEff6qYJ9C8KptsPWJKwPiFo="; - }; - }); -} +final: prev: { }