From 33ab479e227b8be7e9f00cb3ce134087a94e7afb Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 2 Dec 2024 14:37:46 -0600 Subject: [PATCH] modularize android support --- sys/modules/android.nix | 18 ++++++++++++++++++ sys/modules/default.nix | 1 + sys/platforms/posixlycorrect/default.nix | 5 +---- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 sys/modules/android.nix diff --git a/sys/modules/android.nix b/sys/modules/android.nix new file mode 100644 index 0000000..57c1964 --- /dev/null +++ b/sys/modules/android.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.sys.androidSupport; +in { + options.local.sys.androidSupport = { + enable = mkEnableOption "androidSupport settings"; + }; + config = mkIf cfg.enable { + services.udev.packages = with pkgs; [ + android-udev-rules + ]; + }; +} diff --git a/sys/modules/default.nix b/sys/modules/default.nix index 32dae85..512b392 100644 --- a/sys/modules/default.nix +++ b/sys/modules/default.nix @@ -10,5 +10,6 @@ ./audio.nix ./graphics.nix ./virtualisation.nix + ./android.nix ]; } diff --git a/sys/platforms/posixlycorrect/default.nix b/sys/platforms/posixlycorrect/default.nix index 90f6a35..3d36e3b 100644 --- a/sys/platforms/posixlycorrect/default.nix +++ b/sys/platforms/posixlycorrect/default.nix @@ -19,6 +19,7 @@ audio.enable = true; graphics.enable = true; virtualisation.enable = true; + androidSupport.enable = true; }; # Use the systemd-boot EFI boot loader. @@ -53,8 +54,4 @@ }; groups.fabian.gid = 1002; }; - - services.udev.packages = [ - pkgs.android-udev-rules - ]; }