So, I’m trying to move a bash script out of a flake with writeShellScriptBin
and readFile
, as follows:
nanolibs-script = rec {
name = "nanolibs-path";
source = builtins.readFile ./nanolibs-script.sh;
script = (pkgs.writeShellScriptBin name source).overrideAttrs(old: {
buildCommand = "${old.buildCommand}\n patchShebangs $out";
});
buildInputs = [
riscv-toolchain.newlib-nano
];
};
But I’m constantly getting the following error:
error: getting status of '/nix/store/r0bfh3zd9prbkwd4ip9pl7y3i1qxj2g9-source/nanolibs-script.sh': No such file or directory
It seems to be looking for a store but shouldn’t instead be looking into the current directory where the script is? Tried with writeScriptBin
also with a simple script and got the the same result. Also found this, which seems to suggest that there’s some sort of impurity but I dunno what that could be.