mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
Compare commits
5 commits
5d88ff2519
...
7f68d674b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f68d674b3 | ||
|
|
af711651ca | ||
|
|
7c84363a35 | ||
|
|
a7befd8c98 | ||
| 010aa48cf6 |
4 changed files with 30 additions and 22 deletions
33
.github/workflows/emulator.yml
vendored
33
.github/workflows/emulator.yml
vendored
|
|
@ -14,14 +14,17 @@ jobs:
|
|||
path: ${{ steps.droidctl-build.outputs.path }}
|
||||
steps:
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Configure Nix magic cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
uses: nixbuild/nix-quick-install-action@master
|
||||
- name: Configure Nix cache
|
||||
uses: nix-community/cache-nix-action@main
|
||||
with:
|
||||
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}
|
||||
|
||||
- name: Build droidctl
|
||||
id: droidctl-build
|
||||
run: |
|
||||
nix build 'github:t184256/droidctl' --out-link /tmp/droidctl
|
||||
NIXPKGS_ALLOW_UNFREE=1 nix build --impure 'github:t184256/droidctl' --out-link /tmp/droidctl
|
||||
echo "path=$(realpath /tmp/droidctl)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
||||
|
|
@ -30,13 +33,16 @@ jobs:
|
|||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
uses: nixbuild/nix-quick-install-action@master
|
||||
- name: Setup cachix
|
||||
uses: cachix/cachix-action@v14
|
||||
with:
|
||||
name: nix-on-droid
|
||||
- name: Configure Nix magic cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- name: Configure Nix cache
|
||||
uses: nix-community/cache-nix-action@main
|
||||
with:
|
||||
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -132,20 +138,23 @@ jobs:
|
|||
run: tar xf n-o-d.tar
|
||||
|
||||
- name: Install Nix / enable KVM
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Configure Nix magic cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
uses: nixbuild/nix-quick-install-action@master
|
||||
- name: Configure Nix cache
|
||||
uses: nix-community/cache-nix-action@main
|
||||
with:
|
||||
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}
|
||||
|
||||
- name: Fetch droidctl (using previous eval)
|
||||
id: droidctl-fetch
|
||||
env:
|
||||
DROIDCTL: ${{needs.prepare-droidctl.outputs.path}}
|
||||
run: nix build "$DROIDCTL" --out-link /tmp/droidctl
|
||||
continue-on-error: true # GitHub Actions can throttle magic-nix-cache
|
||||
continue-on-error: true # GitHub Actions can throttle cache-nix-action
|
||||
|
||||
- name: Build droidctl (anew, fallback)
|
||||
if: always() && (steps.droidctl-fetch.outcome == 'failure')
|
||||
run: nix build 'github:t184256/droidctl' --out-link /tmp/droidctl
|
||||
run: NIXPKGS_ALLOW_UNFREE=1 nix build --impure 'github:t184256/droidctl' --out-link /tmp/droidctl
|
||||
|
||||
- name: Restore AVD cache
|
||||
id: avd-cache
|
||||
|
|
|
|||
10
flake.nix
10
flake.nix
|
|
@ -77,11 +77,11 @@
|
|||
# deprecated:
|
||||
, config ? null
|
||||
, extraModules ? null
|
||||
, system ? null # pkgs.system is used to detect user's arch
|
||||
, system ? null # pkgs.stdenv.hostPlatform.system is used to detect user's arch
|
||||
}:
|
||||
if ! (builtins.elem pkgs.system [ "aarch64-linux" "x86_64-linux" ]) then
|
||||
if ! (builtins.elem pkgs.stdenv.hostPlatform.system [ "aarch64-linux" "x86_64-linux" ]) then
|
||||
throw
|
||||
("${pkgs.system} is not supported; aarch64-linux / x86_64-linux " +
|
||||
("${pkgs.stdenv.hostPlatform.system} is not supported; aarch64-linux / x86_64-linux " +
|
||||
"are the only currently supported system types")
|
||||
else
|
||||
pkgs.lib.throwIf
|
||||
|
|
@ -95,12 +95,12 @@
|
|||
|
||||
have been removed.
|
||||
Instead of 'extraModules' use the argument 'modules'.
|
||||
The 'system' will be inferred by 'pkgs.system',
|
||||
The 'system' will be inferred by 'pkgs.stdenv.hostPlatform.system',
|
||||
so pass a 'pkgs = import nixpkgs { system = "aarch64-linux"; };'
|
||||
See the 22.11 release notes for more.
|
||||
''
|
||||
(import ./modules {
|
||||
targetSystem = pkgs.system; # system to cross-compile to
|
||||
targetSystem = pkgs.stdenv.hostPlatform.system; # system to cross-compile to
|
||||
inherit extraSpecialArgs home-manager-path pkgs;
|
||||
config.imports = modules;
|
||||
isFlake = true;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ in
|
|||
user = {
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
readOnly = true;
|
||||
default = "nix-on-droid";
|
||||
description = "Group name.";
|
||||
};
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ in
|
|||
|
||||
userName = mkOption {
|
||||
type = types.str;
|
||||
readOnly = true;
|
||||
default = "nix-on-droid";
|
||||
description = "User name.";
|
||||
};
|
||||
|
||||
|
|
@ -90,9 +90,7 @@ in
|
|||
};
|
||||
|
||||
user = {
|
||||
group = "nix-on-droid";
|
||||
home = "/data/data/com.termux.nix/files/home";
|
||||
userName = "nix-on-droid";
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ function doHelp() {
|
|||
echo " --keep-going"
|
||||
echo " --max-jobs NUM"
|
||||
echo " --option NAME VALUE"
|
||||
echo " --override-input INPUT URL"
|
||||
echo " --show-trace"
|
||||
echo
|
||||
echo "Commands"
|
||||
|
|
@ -162,7 +163,7 @@ while [[ $# -gt 0 ]]; do
|
|||
-n|--dry-run)
|
||||
export DRY_RUN=1
|
||||
;;
|
||||
--option)
|
||||
--option|--override-input)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||
shift 2
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue