|
From: toastal <to...@po...> - 2026-09-28 08:11:46
|
I want to use nix-shell which allows getting all tooling for a script <https://nix.dev/manual/nix/2.34/command-ref/nix-shell.html#options>. I’m trying to do #!/usr/bin/env nix-shell #!nix-shell ./env.nix -i factor USE: io IN: hello-world : hello ( -- ) "Hello world" print ; MAIN: hello But when trying to exec my new script, I get 2: #!nix-shell ./env.nix -i factor ^ No word named '#!nix-shell' found in current vocabulary search path The error makes sense if multiline shebangs aren’t supported (yet), but I think this a bug & probably trivial fix. ------------------------------------------------------------------------ NOTE: I would prefer to use plain `nix-shell -i factor` but the factor the binary ends up with a lower priority than `factor` from GNU coreutlis — which means I have to do a hack with an ./env.nix file: { pkgs ? import <nixpkgs> { } }: let inherit (pkgs) lib factor-lang mkShellNoCC nix nixfmt; in mkShellNoCC { buildInputs = [ (lib.hiPrio factor-lang.override { guiSupport = false; }) nix nixfmt ]; } |