nix-on-droid testing branch + lock

This commit is contained in:
2026-08-06 16:19:48 +03:00
parent 2a8b15ce01
commit 8434688515
4 changed files with 190 additions and 37 deletions
+41 -35
View File
@@ -1,10 +1,11 @@
{ inputs, ... }@flakeContext:
let
# Host: epral (Android device via nix-on-droid, aarch64-linux)
# Adapted from test/nix-on-droid.nix — the config that works on the device.
# NOTE: nix-on-droid uses its own module system (class = "nixOnDroid").
# Only options defined by nix-on-droid are available here:
# environment.*, nix.*, time.*, networking.hosts, user.*, home-manager.*, system.stateVersion
# NixOS-only options (boot.*, services.*, hardware.*, fileSystems.*, ...) do NOT exist here.
# Only nix-on-droid options exist here: environment.*, nix.*, time.*,
# networking.hosts, user.*, home-manager.*, system.stateVersion, android-integration.*
# NixOS-only options (boot.*, services.*, hardware.*, fileSystems.*, ...) do NOT exist.
nixOnDroidModule =
{
config,
@@ -13,44 +14,52 @@ let
...
}:
{
# user.home is read-only and always /data/data/com.termux.nix/files/home
user.userName = "oqyude"; # matches xlib.device.username used by the NixOS hosts
# user.userName defaults to "nix-on-droid"; set it to override.
# user.home is read-only: /data/data/com.termux.nix/files/home
environment = {
# Base CLI packages
packages = with pkgs; [
vim
git
ripgrep
htop
file
tmux
];
# Backup existing files in /etc instead of failing activation
etcBackupExtension = ".bak";
};
# Simply install just the packages
environment.packages = with pkgs; [
# User-facing stuff that you really really want to have
vim # or some other editor, e.g. nano or neovim
nano
# Some common stuff that people expect to have
openssh
treefmt
git
procps
psmisc # provides killall (attr `killall` was removed from nixpkgs)
diffutils
findutils
util-linux # renamed from utillinux
tzdata
hostname
man
gnugrep
gnupg
gnused
gnutar
bzip2
gzip
zip
unzip
];
# Backup etc files instead of failing to activate generation if a file already exists in /etc
environment.etcBackupExtension = ".bak";
# Read the changelog before changing this value
system.stateVersion = "24.05";
# Set up nix for flakes
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# Set your time zone
time.timeZone = "Europe/Moscow";
# Read the changelog before changing this value.
# nix-on-droid currently supports state versions only up to "24.05".
system.stateVersion = "24.05";
# home-manager is built in; point it at this repo's home-manager input
# and keep the config self-contained (repo home.nix depends on NixOS-only xlib.dirs).
# home-manager = {
# backupFileExtension = "hm-bak";
# useGlobalPkgs = true;
# config = { config, lib, pkgs, ... }: {
# home.stateVersion = "24.05";
# home.packages = with pkgs; [ ];
# };
# };
android-integration.termux-setup-storage.enable = true;
};
in
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
@@ -60,7 +69,4 @@ inputs.nix-on-droid.lib.nixOnDroidConfiguration {
modules = [
nixOnDroidModule
];
extraSpecialArgs = {
inherit inputs;
};
}