Change:
When trying to add Waydroid, I got this assertion Steps to reproduce the behavior: on NixOs 23.05 Config should work Using for Apple M1 Pro support. <!-- Please @ people who are in the list of the offending package or module. If in doubt, check for whoever last touched something. -- Please run and paste the result. Yes, I know it says 23.11pre-git but I am on NixOS 23.05 in my Flake.
If you're using , you'd be using their kernel. They have their own kernel config, it's not using nixpkgs's: This bug should be filed there.
The problem goes a bit beyond 's kernel. was dropped in kernel 5.18 and yet the Waydroid module mentions this but nobody has changed it.
Tried enabling the needed config options with this: Same assertion error, checked with the required config and all return false on with the stock kernel and with the Asahi kernel. Might not be as simple as just enabling the option.
No because the kernel config system in Nixpkgs would not be able to detect that.
Yeah these are assertions thrown during evaluation. I've also not yet narrowed down the cause, as even with the default latest kernel, ASHMEM is not set but assertion doesn't fail, whereas it does on the Asahi kernel
I mean, I could PR to limit the ASHMEM check to below 5.18, but that doesn't help the remaining two assertions
is set only when the kernel version is between 5.0 and 5.18 as defined in . My non-Asahi stock NixOS system is 6.1.43 and my Asahi NixOS system is 6.3.0. I doubt this is an Asahi NixOS specific problem and might more be of Nixpkgs isn't picking up the kernel config right. Plus I did set other kernel config like to (as mentioned earlier) which the error mentions needing to be set. Despite it being set, it still throws the error saying that option isn't set but it is. So just "enabling ashmem" would not work, especially since was removed from the kernel in 5.18 which is in that version's changelog.
If memfd has to do with the config option , then it should work on M1 since it's already enabled.
But how do I change that when I can't even enable Waydroid in the first place?
Isn't that a file inside the container? I can't even make it without Waydroid enabled. Plus how would that fix the error coming from NixOS? I'm using a Flake so there's no way for it to purely get to that file.
This is not how nix nor the module system works. Creating some random file on the filesystem does not influence evaluation, and has nothing to do with the assertions in If you have another idea, fine, but let's drop this idea about enabling memfd via some random file in . The wiki is also full of nonsense, so let's not bring it into the discussion.
there seems to be something weird about nixos-apple-silicon's kernel. It does not parse . But it does use Concerning ASHMEM, I think we can remove the check and replace it with MEMFD_CREATE. That may be a bit paranoid because it's enabled by default on all NixOS kernels newer than v4.18
I got it to not assert now.

Discussion:
system.requiredKernelConfig = [ (kCfg.isEnabled "ANDROID_BINDER_IPC") (kCfg.isEnabled "ANDROID_BINDERFS") <del> (kCfg.isEnabled "ASHMEM") # FIXME Needs memfd support instead on Linux 5.18 and waydroid 1.2.1 </del> <ins> (kCfg.isEnabled "MEMFD_CREATE") </ins> ]; /* NOTE: we always enable this flag even if CONFIG_PSI_DEFAULT_DISABLED is not on