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 }}
|
path: ${{ steps.droidctl-build.outputs.path }}
|
||||||
steps:
|
steps:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: nixbuild/nix-quick-install-action@master
|
||||||
- name: Configure Nix magic cache
|
- name: Configure Nix cache
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
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
|
- name: Build droidctl
|
||||||
id: droidctl-build
|
id: droidctl-build
|
||||||
run: |
|
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"
|
echo "path=$(realpath /tmp/droidctl)" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,13 +33,16 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: nixbuild/nix-quick-install-action@master
|
||||||
- name: Setup cachix
|
- name: Setup cachix
|
||||||
uses: cachix/cachix-action@v14
|
uses: cachix/cachix-action@v14
|
||||||
with:
|
with:
|
||||||
name: nix-on-droid
|
name: nix-on-droid
|
||||||
- name: Configure Nix magic cache
|
- name: Configure Nix cache
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
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
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -132,20 +138,23 @@ jobs:
|
||||||
run: tar xf n-o-d.tar
|
run: tar xf n-o-d.tar
|
||||||
|
|
||||||
- name: Install Nix / enable KVM
|
- name: Install Nix / enable KVM
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: nixbuild/nix-quick-install-action@master
|
||||||
- name: Configure Nix magic cache
|
- name: Configure Nix cache
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
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)
|
- name: Fetch droidctl (using previous eval)
|
||||||
id: droidctl-fetch
|
id: droidctl-fetch
|
||||||
env:
|
env:
|
||||||
DROIDCTL: ${{needs.prepare-droidctl.outputs.path}}
|
DROIDCTL: ${{needs.prepare-droidctl.outputs.path}}
|
||||||
run: nix build "$DROIDCTL" --out-link /tmp/droidctl
|
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)
|
- name: Build droidctl (anew, fallback)
|
||||||
if: always() && (steps.droidctl-fetch.outcome == 'failure')
|
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
|
- name: Restore AVD cache
|
||||||
id: avd-cache
|
id: avd-cache
|
||||||
|
|
|
||||||
10
flake.nix
10
flake.nix
|
|
@ -77,11 +77,11 @@
|
||||||
# deprecated:
|
# deprecated:
|
||||||
, config ? null
|
, config ? null
|
||||||
, extraModules ? 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
|
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")
|
"are the only currently supported system types")
|
||||||
else
|
else
|
||||||
pkgs.lib.throwIf
|
pkgs.lib.throwIf
|
||||||
|
|
@ -95,12 +95,12 @@
|
||||||
|
|
||||||
have been removed.
|
have been removed.
|
||||||
Instead of 'extraModules' use the argument 'modules'.
|
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"; };'
|
so pass a 'pkgs = import nixpkgs { system = "aarch64-linux"; };'
|
||||||
See the 22.11 release notes for more.
|
See the 22.11 release notes for more.
|
||||||
''
|
''
|
||||||
(import ./modules {
|
(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;
|
inherit extraSpecialArgs home-manager-path pkgs;
|
||||||
config.imports = modules;
|
config.imports = modules;
|
||||||
isFlake = true;
|
isFlake = true;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ in
|
||||||
user = {
|
user = {
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
readOnly = true;
|
default = "nix-on-droid";
|
||||||
description = "Group name.";
|
description = "Group name.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ in
|
||||||
|
|
||||||
userName = mkOption {
|
userName = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
readOnly = true;
|
default = "nix-on-droid";
|
||||||
description = "User name.";
|
description = "User name.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -90,9 +90,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
user = {
|
user = {
|
||||||
group = "nix-on-droid";
|
|
||||||
home = "/data/data/com.termux.nix/files/home";
|
home = "/data/data/com.termux.nix/files/home";
|
||||||
userName = "nix-on-droid";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ function doHelp() {
|
||||||
echo " --keep-going"
|
echo " --keep-going"
|
||||||
echo " --max-jobs NUM"
|
echo " --max-jobs NUM"
|
||||||
echo " --option NAME VALUE"
|
echo " --option NAME VALUE"
|
||||||
|
echo " --override-input INPUT URL"
|
||||||
echo " --show-trace"
|
echo " --show-trace"
|
||||||
echo
|
echo
|
||||||
echo "Commands"
|
echo "Commands"
|
||||||
|
|
@ -162,7 +163,7 @@ while [[ $# -gt 0 ]]; do
|
||||||
-n|--dry-run)
|
-n|--dry-run)
|
||||||
export DRY_RUN=1
|
export DRY_RUN=1
|
||||||
;;
|
;;
|
||||||
--option)
|
--option|--override-input)
|
||||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue