mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
modules/android_integration: termux-setup-storage & unsupported
This commit is contained in:
parent
c4c4f09e3d
commit
733a9fe55c
7 changed files with 265 additions and 4 deletions
|
|
@ -7,6 +7,10 @@ let
|
|||
|
||||
termux-am =
|
||||
pkgs.callPackage (import ../../pkgs/android-integration/termux-am.nix) { };
|
||||
termux-tools =
|
||||
pkgs.callPackage (import ../../pkgs/android-integration/termux-tools.nix) {
|
||||
inherit termux-am;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
|
|
@ -25,12 +29,35 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
termux-setup-storage.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = "true";
|
||||
description = lib.mdDoc ''
|
||||
Provide a `termux-setup-storage` command
|
||||
that makes the app request storage permission,
|
||||
and then creates a $HOME/storage directory with symlinks to storage.
|
||||
'';
|
||||
};
|
||||
|
||||
unsupported.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = "true";
|
||||
description = lib.mdDoc ''
|
||||
Provide several more unsupported and untested commands.
|
||||
For testing and for brave souls only.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = {
|
||||
config = let ifD = cond: pkg: if cond then [ pkg ] else [ ]; in {
|
||||
environment.packages =
|
||||
lib.mkIf cfg.am.enable [ termux-am ];
|
||||
(ifD cfg.am.enable termux-am) ++
|
||||
(ifD cfg.termux-setup-storage.enable termux-tools.setup_storage) ++
|
||||
(ifD cfg.unsupported.enable termux-tools.out);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue