nix config for my personal machines
README.md

Android Provisioning Module#

This module provides a declarative way to provision Android devices using ADB. It generates a shell script that enforces a desired state:

  1. Debloat: Disables packages via pm disable-user or uninstalls them via pm uninstall -k --user 0.
  2. Install: Installs APKs from specified URLs (idempotent).
  3. Sync: Pushes files from the Nix store/local path to the device.

Usage#

Import this module in your flake and use the provision function.

# modules/android/default.nix
{ pkgs, config }:
let
  android = import ./modules/android { inherit pkgs; inherit (pkgs) lib; };
in
android.provision {
  name = "my-device";
  serial = "DEVICE_SERIAL"; # Optional
  
  disable = [ "com.unwanted.system.app" ];

  uninstall = [ "com.bloatware.app" ];
  
  install = [
    {
      name = "F-Droid";
      src = pkgs.fetchurl { ... };
    }
  ];
  
  files = {
    "./local-file.png" = "/sdcard/Pictures/remote-file.png";
  };
}