nixos/anbox: handle new kernel configurations
This commit is contained in:
parent
708e1eb8ba
commit
cdc51c811a
|
@ -5,7 +5,7 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.virtualisation.anbox;
|
cfg = config.virtualisation.anbox;
|
||||||
kernelPackages = config.boot.kernelPackages;
|
|
||||||
addrOpts = v: addr: pref: name: {
|
addrOpts = v: addr: pref: name: {
|
||||||
address = mkOption {
|
address = mkOption {
|
||||||
default = addr;
|
default = addr;
|
||||||
|
@ -67,16 +67,19 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
assertions = singleton {
|
assertions = singleton {
|
||||||
assertion = versionAtLeast (getVersion config.boot.kernelPackages.kernel) "4.18";
|
assertion = with config.boot.kernelPackages; kernelAtLeast "5.5" && kernelOlder "5.18";
|
||||||
message = "Anbox needs user namespace support to work properly";
|
message = "Anbox needs a kernel with binder and ashmem support";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ anbox ];
|
environment.systemPackages = with pkgs; [ anbox ];
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
systemd.mounts = singleton {
|
||||||
KERNEL=="ashmem", NAME="%k", MODE="0666"
|
requiredBy = [ "anbox-container-manager.service" ];
|
||||||
KERNEL=="binder*", NAME="%k", MODE="0666"
|
description = "Anbox Binder File System";
|
||||||
'';
|
what = "binder";
|
||||||
|
where = "/dev/binderfs";
|
||||||
|
type = "binder";
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.lxc.enable = true;
|
virtualisation.lxc.enable = true;
|
||||||
networking.bridges.anbox0.interfaces = [];
|
networking.bridges.anbox0.interfaces = [];
|
||||||
|
|
Loading…
Reference in a new issue