Open lorenzleutgeb opened 1 year ago
I have pondered this for quite a while and I certainly want a good solution for this. Sadly I see a huge footgun potential here. nom takes nix from the PATH. In your case with the alias you are actually fine, but imagine someone using a symlink nix -> nom, then nom will recusively call itself.
Ah, well. You actually don't set nix -> nom.
I agree that symlinking nix -> nom
is a no-go. Also, removing nix
from $PATH
is a no-go.
In some cases (nom [build|develop|shell]
) nom
will exec nix
anyway. I am asking that nom
also does this for any other subcommand.
Whether someone wants to alias nix=nom
is a different matter. I am not suggesting that nom
should do aliasing, but I am asking to really support aliasing. For me, when I read "drop in replacement" (like in your README) I expect a plain alias to work. And not just for a few subcommands, but for all of them. See e.g. mislav/hub where you have an alias git=hub
situation.
If I ever have a problem with the alias, I just remove it and run nix
directly.
Point taken. I had this on my radar anyway and will look into it.
@lorenzleutgeb you can have a look at my code in https://github.com/maralorn/nix-output-monitor/issues/108 to create your own aliases. It's not 100% battle-tested but it's a starting point.
Thanks @zeorin, that's super cool to see, but way too involved for me at the moment.
I did
alias nix=nom
, and was very pleased with my newnix build
experience. Then, I wanted to runnix repl
, and was frustrated thatnom
does not "forward" this command tonix
transparently, i.e., it did not invokenix repl
.As long as you don't support all
nix
subcommands, please consider to just invokenix
: The commandnom foobar
should invokenix foobar
.In the meantime, I'll be using this workaround via Home Manager:
(and
alias nix=nix-nom
)