mkShell.inputsFrom breaks bash

I present you the bug that is so beyond my comprehension, I am surprised I have managed to isolate it at all.

Steps to reproduce

  1. Extract the archive, cd into it.
  2. Run nix develop, then cargo run. You would see an infinite loading indicator.
  3. Press Ctrl+C.

The expected behavior is that the script waits for 2 seconds, prints a message, exits and the terminal PS1 prompt is shown.

To get the bug, you have to uncomment line 41 in flake.nix (don’t forget to restart the devShell). Now when you run the cargo run and press Ctrl+C the program would exit immediately, showing the PS1 prompt, and after 2 seconds it would print above the PS1 prompt.

Minimal Reproducible Example

https://files.catbox.moe/gj1kod.zip

Screencast of the issue

I did not show that in he video, but running the executable outside of the Nix’s devShell does not have the same behaviour.

(link to the video in case the attachment is not loading)

P.S. Ignore the “I have no name!” thing. Somehow that’s an issue with my system — link.