Add adb persistence
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,7 +1,26 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
}:
|
||||
{ ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
android-tools = pkgs.android-tools.overrideAttrs (oldAttrs: {
|
||||
patches = oldAttrs.patches or [ ] ++ [ ./env-var-user-home.patch ];
|
||||
});
|
||||
in
|
||||
{
|
||||
services.udev.packages = with pkgs; [ android-udev-rules ];
|
||||
environment.systemPackages = [ android-tools ];
|
||||
services.gvfs.enable = true;
|
||||
|
||||
users.users.${username}.extraGroups = [ "adbusers" ];
|
||||
|
||||
home-manager.users.${username}.home = {
|
||||
sessionVariables.ANDROID_USER_HOME = "${hmConfig.xdg.dataHome}/android";
|
||||
persistence."/persist${userConfig.home}".files = [
|
||||
"${hmConfig.xdg.dataHome}/android/adbkey"
|
||||
"${hmConfig.xdg.dataHome}/android/adbkey.pub"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user