We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80c18db commit 0c52cbeCopy full SHA for 0c52cbe
modules/wsl-distro.nix
@@ -67,8 +67,22 @@ with builtins; with lib;
67
binfmt.registrations = mkIf cfg.interop.register {
68
WSLInterop = {
69
magicOrExtension = "MZ";
70
- interpreter = "/init";
+
71
+ # FIXME: temporary hack for https://github.com/nix-community/NixOS-WSL/pull/84
72
+ interpreter = pkgs.writeShellScript "nixos-wsl-binfmt-hack" ''
73
+ /init /nixos-wsl-does-not-exist.exe
74
+ if [ $? -eq 1 ]; then
75
+ # new style /init wants preserve-argv0
76
+ exec /init $@
77
+ else
78
+ # old style /init does not
79
+ shift
80
81
+ fi
82
+ '';
83
84
fixBinary = true;
85
+ preserveArgvZero = true;
86
};
87
88
0 commit comments