-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
fix: explicitly add systemctl and grep to path in shell-wrapper #240
Conversation
We can generally find them in /run/current-system/sw/bin, but WSL may try to call those before activation is fully done, so make sure it can always find what it needs.
@@ -4,6 +4,7 @@ with lib; | |||
|
|||
let | |||
bashWrapper = pkgs.writeShellScriptBin "sh" '' | |||
export PATH=${lib.makeBinPath [ pkgs.systemd pkgs.gnugrep ]} | |||
. ${config.system.build.etc}/etc/set-environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this PATH get set here? Not sure where a command should be executed here. I am probably missing some context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/etc/set-environment sets PATH to /run/current-system/sw/bin
, but the /run/current-system
symlink might not exist when WSL first tries to systemctl | grep
things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, I see. We should comment that.
@@ -4,6 +4,7 @@ with lib; | |||
|
|||
let | |||
bashWrapper = pkgs.writeShellScriptBin "sh" '' | |||
export PATH=${lib.makeBinPath [ pkgs.systemd pkgs.gnugrep ]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export PATH=${lib.makeBinPath [ pkgs.systemd pkgs.gnugrep ]} | |
export PATH=${lib.makeBinPath with pkgs; [ systemd gnugrep ]} |
If we're doing that, shouldn't we just add |
I'm not sure, I'd rather have the bare minimum needed by the WSL machinery here and handle the rest in a way that's as conventional as possible. |
We could also just put a busybox in there. That would be future-proof as well and less easy to brick by changing the system config |
They do call systemctl, so we can't just put a busybox in there. |
Right, I meant that more as "instead of |
I'm 100% expecting WSL to assume gnugrep there tbh. |
We can generally find them in /run/current-system/sw/bin, but WSL may try to call those before activation is fully done, so make sure it can always find what it needs.