-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
feat: use internal WSL knobs instead of symlinks #281
Conversation
Filed an issue with upstream to maybe stabilize these: microsoft/WSL#10425 |
This makes things so much easier and more consistent and it's undocumented API that I found in Ghidra so nothing could possibly go wrong.
This looks so much better. I hope they decide to keep these |
@@ -41,6 +41,21 @@ with lib; { | |||
default = false; | |||
description = "Use systemd as init. There's no need to enable this manually, use the wsl.nativeSystemd option instead"; | |||
}; | |||
initPath = mkOption { | |||
type = path; |
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 need to be nullOr path
?
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.
Probably, I haven't actually tested this on non-native-systemd yet.
systemd = true; | ||
initPath = "${nativeUtils}/bin/systemd-shim"; | ||
initShutdownCommand = pkgs.writeShellScript "nixos-wsl-init-shutdown" '' | ||
${pkgs.systemd}/bin/systemctl reboot |
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.
${pkgs.systemd}/bin/systemctl reboot | |
${pkgs.systemd}/bin/systemctl reboot "$@" |
just incase
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.
I'm actually pretty sure we can avoid the shell script here and just write the string directly.
This is drifting out of sync and I don't want to maintain it until upstream decides this is OK to do. Closing for now, we can revisit later. |
This makes things so much easier and more consistent and it's undocumented API that I found in Ghidra so nothing could possibly go wrong.