add x86_64 arch

This commit is contained in:
Alexander Sosedkin 2024-06-15 14:35:28 +02:00
parent 463e0f82a6
commit d72ab2a167
17 changed files with 89 additions and 40 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
{ config, lib, pkgs, ... }:
@ -12,8 +12,8 @@ with lib;
build = {
arch = mkOption {
type = types.enum [ "aarch64" ];
default = "aarch64";
type = types.enum [ "aarch64" "x86_64" ];
default = strings.removeSuffix "-linux" builtins.currentSystem;
internal = true;
description = "Destination arch.";
};

View file

@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
{ config, lib, pkgs, initialPackageInfo, ... }:
@ -82,7 +82,14 @@ in
environment.files = {
inherit login loginInner;
prootStatic = "/nix/store/7w09z1kw62wg7nv3q3z2p6kxf1ihk178-proot-termux-static-aarch64-unknown-linux-android-unstable-2023-11-11";
prootStatic =
let
crossCompiledPaths = {
aarch64 = "/nix/store/7w09z1kw62wg7nv3q3z2p6kxf1ihk178-proot-termux-static-aarch64-unknown-linux-android-unstable-2023-11-11";
x86_64 = "/nix/store/i6jppi627sakbgm5x2a8jjdfyv8571zc-proot-termux-static-x86_64-unknown-linux-android-unstable-2023-11-11";
};
in
"${crossCompiledPaths.${config.build.arch}}";
};
};

View file

@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
{ config, lib, initialPackageInfo, writeText }:
@ -80,9 +80,10 @@ writeText "login-inner" ''
${nixCmd} flake new ${config.user.home}/.config/nix-on-droid --template ${config.build.flake.nix-on-droid}
${lib.optionalString config.build.flake.inputOverrides ''
echo "Overriding input urls in flake..."
echo "Overriding input urls / arch in flake..."
${nixCmd} run nixpkgs#gnused -- \
-i \
-e 's,\"aarch64-linux",\"${config.build.arch}-linux\",' \
-e 's,\"github:NixOS/nixpkgs.*\",\"${config.build.flake.nixpkgs}\",' \
-e 's,\"github:nix-community/nix-on-droid.*\",\"${config.build.flake.nix-on-droid}\",' \
"${config.user.home}/.config/nix-on-droid/flake.nix"