Renaming packages on install

  • system: "aarch64-darwin"
  • host os: Darwin 21.6.0, macOS 12.7.6
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.18.8
  • channels(root): "nixpkgs"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

So I have a bash script that checks for ggrep and gsed. If it’s not in the PATH it suggests using homebrew to install it. Homebrew installs gnu-grep as ggrep. Nix installs gnu-grep as grep.
I have modified the script as a work around, however I don’t think it’s ideal. A better solution for my use would be to have both the Mac grep (BSD) and gnu-grep as ggrep. So, is there a way to rename gnu-grep to ggrep with Nix?

Thanks