Open tobiasBora opened 10 months ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nix-shell-shebang-flakes-haskell/38064/4
This only works with nix 2.19 and up.
Ok thanks, I tried to run the latest nix version via nix shell, but it was of course only in the current shell, while I guess nix-env nix
would use the system nix. But I have 2 questions:
-S
syntax in the doc that works for any version of nix?//! ```cargo
//! [dependencies]
//! time = "0.1.25"
//! ```
documented somewhere?
Reopening since the nixVersions.stable update was reverted.
On second review, I don't know that we can do much in nixpkgs. Upgrading nix is dependent on nix upstream providing a version of nix > 2.19 that also does not cause regressions especially for our nixos tests. And the documentation is also out of our control.
Describe the bug
The documentation here https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html?highlight=shebang#shebang-interpreter mentions that one can create an executable file:
and run it, but I get an error:
I found a solution using the
-S
option ofenv
like:This works, but I don't see how to run this way more complex stuff. For instance, the documentation mentions that we can run:
but I get the same error.
Steps To Reproduce
Steps to reproduce the behavior: just described in previous section.
Notify maintainers
Metadata
I'm running NixOs 2caf4ef5005ecc68141ecb4aac271079f7371c44
Add a :+1: reaction to issues you find important.