-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if the selected shell is a directory #408
Conversation
is it possible to catch this at evaluation time? |
I added a check at evaulation time, but kept the old checks as a kind of defense in depth. I only tested it using |
OK, maybe I'm asking for the impossible, because pathExists will fail if it's not instantiated yet =/ |
Ah, that's sad. I searched a bit and didn't found a way, so I reverted to the initial state. But my nix-fu is not great so if you have an idea about implementing the check at the evaluation time, I will implement it. |
Just to be clear, ain't your fault that you didn't deliver when I asked for impossible. |
Got me curious about what magic is NixOS doing then, and it looks like it accepts derivations as long as they set Would it make sense to follow suit and:
|
That is great. I implemented it but tested it only on nix eval, so a double check would be great. |
Yeah, looks great! Don't worry, I'll (eventually) cover this with tests, likely by extending poke_around.py. Note to self, test:
|
Hi, I've been writing tests for the feature you've implemented, and they've uncovered a small problem (should be visible if you go to CI,
|
I fixed the problem, and also removed the "unlike nixos" part since now we are similar to the nixos if I understand correctly. Tests look good to me, I just wonder why you didn't use f-strings instead of By the way, I really enjoyed your test infrastructure. |
Yeah, makes sense.
I found it more readable than duplicating all the curly brackets.
Thank you. =) |
I guess this time the failure is random? |
Yep. Everything looks in order now. I'd appreciate if you integrated the fixes into the 1st and 2nd commits respectively, so that both resulting commits would be "green", but if you don't want to, I can do it later myself. Thank you! |
Setting
user.shell = pkgs.fish
or similar is a common footgun that completely breaks the nix-on-droid. See #284.This PR try to address the problem by checking that if the shell is a directory and falling back to bash in that case. This fix the common cause that many people hit that issue, but a general fix for that issue should probably include a way to switch generations without using the terminal, since setting the
user.shell
wrongly isn't probably the only way to break nix-on-droid.