diff options
author | Samuel Dionne-Riel <samuel@dionne-riel.com> | 2021-06-03 21:59:08 -0400 |
---|---|---|
committer | rnhmjoj <rnhmjoj@inventati.org> | 2023-09-05 10:09:43 +0200 |
commit | cdc51c811a492b8b7e20e2c579cb51a57d6dc922 (patch) | |
tree | 9782b586b504610077e6c9b32a682037cfdac037 /nixos | |
parent | 708e1eb8ba6403e9ff03586204b74c9b293b9810 (diff) |
nixos/anbox: handle new kernel configurations
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/anbox.nix | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/nixos/modules/virtualisation/anbox.nix b/nixos/modules/virtualisation/anbox.nix index 0473742c85500..6323a3b72c538 100644 --- a/nixos/modules/virtualisation/anbox.nix +++ b/nixos/modules/virtualisation/anbox.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.virtualisation.anbox; - kernelPackages = config.boot.kernelPackages; + addrOpts = v: addr: pref: name: { address = mkOption { default = addr; @@ -67,16 +67,19 @@ in config = mkIf cfg.enable { assertions = singleton { - assertion = versionAtLeast (getVersion config.boot.kernelPackages.kernel) "4.18"; - message = "Anbox needs user namespace support to work properly"; + assertion = with config.boot.kernelPackages; kernelAtLeast "5.5" && kernelOlder "5.18"; + message = "Anbox needs a kernel with binder and ashmem support"; }; environment.systemPackages = with pkgs; [ anbox ]; - services.udev.extraRules = '' - KERNEL=="ashmem", NAME="%k", MODE="0666" - KERNEL=="binder*", NAME="%k", MODE="0666" - ''; + systemd.mounts = singleton { + requiredBy = [ "anbox-container-manager.service" ]; + description = "Anbox Binder File System"; + what = "binder"; + where = "/dev/binderfs"; + type = "binder"; + }; virtualisation.lxc.enable = true; networking.bridges.anbox0.interfaces = []; |