✨ Declarative mobile environment with Flakes 📱 Snowflake-inspired infrastructure for your Android devices
- Android device with Nix-on-Droid installed from F-Droid
- Git available on the device (can be installed via
nix run nixpkgs#git) - NixOS 24.05 compatible flake inputs
# Clone the repository
nix run nixpkgs#git -- clone https://codeberg.org/ponfertato/nodcfg ~/.config/nixpkgs
cd ~/.config/nixpkgs
# Build and activate configuration for your device
nix-on-droid switch --flake ~/.config/nixpkgs#potatoPhone
# or
nix-on-droid switch --flake ~/.config/nixpkgs#potatoTabletnodcfg/
├── flake.nix # ❄️ Nix-on-Droid entry point + unstable overlay
├── profiles/ # 🧩 Modular system profiles
│ ├── core/ # 🖥️ Base: locale, nix settings, common packages
│ │ └── default.nix
│ └── user/ # 👤 User roles (multi-user ready)
│ └── ponfertato/ # 👤 Current user profile
│ └── default.nix # Git config, shell aliases, user packages
└── hosts/ # 📱 Host-specific configs
├── potatoPhone/ # 📱 Phone-specific packages
│ └── default.nix
└── potatoTablet/ # 📱 Tablet-specific packages
└── default.nix
Path in nixcfg (NixOS) |
Path in nodcfg (Nix-on-Droid) |
|---|---|
profiles/core/ |
profiles/core/ |
profiles/user/ponfertato/ |
profiles/user/ponfertato/ |
hosts/potatoWork/, hosts/potatoLaptop/ |
hosts/potatoPhone/, hosts/potatoTablet/ |
The same mental model applies to both repositories — only the system-level options differ (environment.systemPackages vs environment.packages, programs.firefox vs environment.etc."gitconfig", etc.).
nix-odnix-updatenix-update && nix-check && nix-odnix-rollnix-gcnix-check# Update flake inputs
nix flake update
# Rebuild and activate
nix-on-droid switch --flake ~/.config/nixpkgs#$(hostname)nix search nixpkgs <package> # in stable (nixos-24.05)
nix search nixpkgs-unstable <package> # in unstable- 📱 Multi-Device Support: Share base config across
potatoPhoneandpotatoTablet - 🛡️ Reproducible Builds: Fully declarative configuration with Flakes
- ⚙️ Optimized Nix Settings: Yandex mirror + custom substituters for faster builds
- 🔥 Unstable Overlay: Access
pkgs.unstable.*without extra args - 👤 No Home Manager: Pure Nix-on-Droid via
environment.packages,environment.etc,env.shellInit - 🔄 Easy Rollback:
nix-rollto revert to previous generation - 🧹 Auto GC: Weekly garbage collection
- 🔀 Symmetric with
nixcfg: Same folder layout for easy navigation
- Add
hosts/<device_name>/default.nix - Register it in
flake.nixundernixOnDroidConfigurations - Apply:
nix-on-droid switch --flake .#<device_name>
- Common packages (all devices): edit
profiles/core/default.nix - User-specific packages: edit
profiles/user/ponfertato/default.nix - Device-specific packages: edit
hosts/<device_name>/default.nix
- Git config:
profiles/user/ponfertato/default.nix→environment.etc."gitconfig" - Git ignores:
profiles/user/ponfertato/default.nix→environment.etc."gitignore_global" - Shell aliases:
profiles/user/ponfertato/default.nix→env.shellInit
- Create
profiles/user/<username>/default.nix - Import it from the desired host instead of
ponfertato