Hi all, I’ve written a short script derivation in my ~/.config/nixpkgs/config.nix
that nix doesn’t like the bash syntax of.
{
...
packageOverrides = pkgs: with pkgs; rec {
...
foosh = pkgs.writeShellScriptBin “foolish” ‘’
function help { ... }
items=( “$@“ )
(for e in "${items[@]}"; do [[ "$e" =~ ^(--)?help$ ]] && exit 0; done; exit 1) && help
...
‘’;
...
myPackges = buildEnv {
name = “my-packages”;
paths = [
foosh
...
];
...
}
I’m getting the following error, however:
% nix-env -iA nixpkgs.myPackages
error: syntax error, unexpected '@', at /Users/ldeck/.config/nixpkgs/config.nix:32:26
It appears nix config doesn’t like some permissible bash syntax.
What’s recommended for this situation?