summary refs log tree commit diff
path: root/nixos/modules/virtualisation/anbox.nix
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2021-06-03 21:59:08 -0400
committerrnhmjoj <rnhmjoj@inventati.org>2023-09-05 10:09:43 +0200
commitcdc51c811a492b8b7e20e2c579cb51a57d6dc922 (patch)
tree9782b586b504610077e6c9b32a682037cfdac037 /nixos/modules/virtualisation/anbox.nix
parent708e1eb8ba6403e9ff03586204b74c9b293b9810 (diff)
downloadnixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.tar
nixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.tar.gz
nixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.tar.bz2
nixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.tar.lz
nixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.tar.xz
nixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.tar.zst
nixpkgs-cdc51c811a492b8b7e20e2c579cb51a57d6dc922.zip
nixos/anbox: handle new kernel configurations
Diffstat (limited to 'nixos/modules/virtualisation/anbox.nix')
-rw-r--r--nixos/modules/virtualisation/anbox.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/nixos/modules/virtualisation/anbox.nix b/nixos/modules/virtualisation/anbox.nix
index 0473742c855..6323a3b72c5 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 = [];