Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
outputs = { self, nixpkgs, flake-utils, rust-overlay, foundry, solc, nixpkgs-old }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) foundry.overlay solc.overlay ];
wasm-bindgen-overlay = final: prev: {
wasm-bindgen-cli = prev.wasm-bindgen-cli_0_2_100;
};
overlays = [ (import rust-overlay) foundry.overlay solc.overlay wasm-bindgen-overlay ];
Comment on lines +17 to +20
Copy link

@coderabbitai coderabbitai bot Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Add an explicit guard if wasm-bindgen-cli_0_2_100 disappears.

Because the nixpkgs input is floating, a future nix flake update could drop or rename the versioned attribute and fail with a confusing evaluation error. Consider a clear guard/throw so failures are explicit.

Please verify in the currently pinned nixpkgs revision (flake.lock) that wasm-bindgen-cli_0_2_100 exists for all target systems.

♻️ Proposed guard for clearer failure
-        wasm-bindgen-overlay = final: prev: {
-          wasm-bindgen-cli = prev.wasm-bindgen-cli_0_2_100;
-        };
+        wasm-bindgen-overlay = final: prev: {
+          wasm-bindgen-cli =
+            if prev ? wasm-bindgen-cli_0_2_100
+            then prev.wasm-bindgen-cli_0_2_100
+            else throw "nixpkgs missing wasm-bindgen-cli_0_2_100; pin nixpkgs or update rain.wasm";
+        };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
wasm-bindgen-overlay = final: prev: {
wasm-bindgen-cli = prev.wasm-bindgen-cli_0_2_100;
};
overlays = [ (import rust-overlay) foundry.overlay solc.overlay wasm-bindgen-overlay ];
wasm-bindgen-overlay = final: prev: {
wasm-bindgen-cli =
if prev ? wasm-bindgen-cli_0_2_100
then prev.wasm-bindgen-cli_0_2_100
else throw "nixpkgs missing wasm-bindgen-cli_0_2_100; pin nixpkgs or update rain.wasm";
};
overlays = [ (import rust-overlay) foundry.overlay solc.overlay wasm-bindgen-overlay ];
🤖 Prompt for AI Agents
In `@flake.nix` around lines 17 - 20, Add an explicit guard around the use of
wasm-bindgen-cli_0_2_100 inside the wasm-bindgen-overlay so nix evaluation fails
with a clear message if that attribute is missing; update the
wasm-bindgen-overlay (referencing the symbol wasm-bindgen-overlay and the
attribute wasm-bindgen-cli_0_2_100) to check for prev.wasm-bindgen-cli_0_2_100
and throw or call builtins.error with a descriptive message if it is
null/undefined, and adjust the overlays list (the overlays binding where
rust-overlay, foundry.overlay, solc.overlay, wasm-bindgen-overlay are combined)
accordingly; also verify the currently pinned nixpkgs revision in flake.lock to
confirm wasm-bindgen-cli_0_2_100 exists for all target systems and document that
check in the commit message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.2.100 works and we have no need to track latest. If a future nixpkgs removes this attribute, we'll deal with it then

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@findolor, understood! I'll note your preference for handling nixpkgs attribute changes reactively. The pinned version meets your current needs, and you're comfortable addressing any future nixpkgs changes if they arise.


✏️ Learnings added
Learnt from: findolor
Repo: rainlanguage/rainix PR: 101
File: flake.nix:17-20
Timestamp: 2026-01-22T13:45:52.516Z
Learning: In the rainix project, the team prefers to handle nixpkgs versioned attribute removals reactively rather than adding defensive guards. They don't need to track latest versions if a pinned version works for their use case.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

pkgs = import nixpkgs { inherit system overlays; };
old-pkgs = import nixpkgs-old { inherit system; };

Expand Down
Loading