Ihar Hancharenka 5dff80e88e first
2023-03-27 16:52:17 +03:00

10 строки
683 B
Plaintext
Исходник Ответственный История

Этот файл содержит неоднозначные символы Юникода

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

https://www.reddit.com/r/NixOS/comments/k8ja54/nixos_running_scripts_problem/
/bin/bash doesnt exist on a NixOS system, because everything is stored on the Nix store (/nix/store/)
You can check the actual location of your bash executable with readlink $(which bash).
Because your current session contains /run/current-system/sw/bin in its $PATH,
youll be able to run currently installed commands, and /run/current-system/sw/bin/bash will be a symlink to the Nix store
Of course, you shouldnt put this exact path in your scripts shebangs.
Instead, the best way to run bash scripts, in any system, is to use
#!/usr/bin/env bash
as shebang.