mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-12-14 04:51:11 +01:00
Grab proot from bootstrap zip rather than including its nix path directly.
This means that the cachix substituter (or already having the package in your nix store somehow) is no longer required to build. This required reworking the deploy script. As a bonus you can now omit the second argument and it will tell you what it would have copied instead of copying anything. This is fixes one source of impurity, but for now flake builds will still require the --impure flag
This commit is contained in:
parent
5d88ff2519
commit
9dd9078a1f
12 changed files with 279 additions and 122 deletions
|
|
@ -37,7 +37,7 @@ in
|
|||
|
||||
prootStatic = mkOption {
|
||||
type = types.package;
|
||||
readOnly = true;
|
||||
# not readOnly, this needs to be overridden when building bootstrap zip
|
||||
internal = true;
|
||||
description = "<literal>proot-static</literal> package.";
|
||||
};
|
||||
|
|
@ -84,14 +84,27 @@ in
|
|||
environment.files = {
|
||||
inherit login loginInner;
|
||||
|
||||
# Ideally this would build the static proot binary, but doing that on aarch64 is HARD so instead pull it from the bootstrap tarball
|
||||
prootStatic =
|
||||
let
|
||||
crossCompiledPaths = {
|
||||
aarch64-linux = "/nix/store/7qd99m1w65x2vgqg453nd70y60sm3kay-proot-termux-static-aarch64-unknown-linux-android-unstable-2024-05-04";
|
||||
x86_64-linux = "/nix/store/pakj3svvw84rhkzdc6211yhc2cgvc21f-proot-termux-static-x86_64-unknown-linux-android-unstable-2024-05-04";
|
||||
attrs = (import ./proot-attrs).${targetSystem};
|
||||
prootFile = pkgs.fetchurl {
|
||||
name = "proot-static-file";
|
||||
inherit (attrs) url hash;
|
||||
|
||||
downloadToTemp = true;
|
||||
executable = true;
|
||||
postFetch = ''
|
||||
${pkgs.unzip}/bin/unzip -u $downloadedFile bin/proot-static
|
||||
echo $PWD >&2
|
||||
mv bin/proot-static $out
|
||||
'';
|
||||
};
|
||||
in
|
||||
"${crossCompiledPaths.${targetSystem}}";
|
||||
pkgs.runCommand "proot-static" { } ''
|
||||
mkdir -p $out/bin
|
||||
cp ${prootFile} $out/bin/proot-static
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
5
modules/environment/login/proot-attrs/aarch64.nix
Normal file
5
modules/environment/login/proot-attrs/aarch64.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# WARNING: This file is autogenerated by the deploy script. Any changes will be overridden
|
||||
{
|
||||
url = "https://nix-on-droid.unboiled.info/bootstrap-testing/bootstrap-aarch64.zip";
|
||||
hash = "sha256-fZyqldmHWbv2e6543mwb5UPcKxcODRg+PDvZNcjVyUU=";
|
||||
}
|
||||
4
modules/environment/login/proot-attrs/default.nix
Normal file
4
modules/environment/login/proot-attrs/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
x86_64-linux = import ./x86_64.nix;
|
||||
aarch64-linux = import ./aarch64.nix;
|
||||
}
|
||||
5
modules/environment/login/proot-attrs/x86_64.nix
Normal file
5
modules/environment/login/proot-attrs/x86_64.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# WARNING: This file is autogenerated by the deploy script. Any changes will be overridden
|
||||
{
|
||||
url = "https://nix-on-droid.unboiled.info/bootstrap-testing/bootstrap-x86_64.zip";
|
||||
hash = "sha256-1WZBmFNEmZucOwuzDAFO+Sl+b2XO7Lp1aQr/4egl4wU=";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue