mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
bootstrap: flakify bootstrap zip ball generation
This commit is contained in:
parent
b10dd78e18
commit
274bb4babd
8 changed files with 58 additions and 40 deletions
|
|
@ -1,9 +1,9 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ config }:
|
||||
{ config, nixpkgs, system }:
|
||||
|
||||
let
|
||||
loadNixpkgs = import ../lib/load-nixpkgs.nix;
|
||||
{
|
||||
inherit system;
|
||||
|
||||
crossSystem = {
|
||||
config = "${config.build.arch}-unknown-linux-android";
|
||||
|
|
@ -13,7 +13,4 @@ let
|
|||
useLLVM = true;
|
||||
isStatic = true;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
loadNixpkgs { inherit crossSystem; }
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ callPackage, tallocStatic }:
|
||||
{ callPackage, nixpkgs, tallocStatic }:
|
||||
|
||||
let
|
||||
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||
pkgsCross = import nixpkgs (callPackage ./cross-pkgs-args.nix { });
|
||||
stdenv = pkgsCross.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||
|
||||
in
|
||||
|
||||
pkgsCross.callPackage ../proot-termux {
|
||||
talloc = tallocStatic;
|
||||
inherit stdenv;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ callPackage
|
||||
, nixpkgs
|
||||
, fetchurl
|
||||
, python3
|
||||
, pkg-config
|
||||
|
|
@ -8,7 +9,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||
pkgsCross = import nixpkgs (callPackage ./cross-pkgs-args.nix { });
|
||||
in
|
||||
|
||||
pkgsCross.stdenv.mkDerivation rec {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,29 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ arch ? "aarch64", nixOnDroidChannelURL ? null, nixpkgsChannelURL ? null }:
|
||||
{ nixpkgs
|
||||
, system
|
||||
, arch ? "aarch64"
|
||||
, nixOnDroidChannelURL ? null
|
||||
, nixpkgsChannelURL ? null
|
||||
}:
|
||||
|
||||
let
|
||||
nixDirectory = callPackage ./nix-directory.nix { };
|
||||
initialPackageInfo = import "${nixDirectory}/nix-support/package-info.nix";
|
||||
|
||||
nixpkgs = import lib/load-nixpkgs.nix { };
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
modules = import ../modules {
|
||||
pkgs = nixpkgs;
|
||||
inherit pkgs;
|
||||
|
||||
extraModules = [ ../modules/build/initial-build.nix ];
|
||||
extraSpecialArgs = {
|
||||
inherit initialPackageInfo;
|
||||
pkgs = nixpkgs.lib.mkForce nixpkgs; # to override ./modules/nixpkgs/config.nix
|
||||
pkgs = pkgs.lib.mkForce pkgs; # to override ./modules/nixpkgs/config.nix
|
||||
};
|
||||
|
||||
isFlake = true;
|
||||
|
||||
config = {
|
||||
# Fix invoking bash after initial build.
|
||||
user.shell = "${initialPackageInfo.bash}/bin/bash";
|
||||
|
|
@ -24,7 +31,7 @@ let
|
|||
build = {
|
||||
inherit arch;
|
||||
|
||||
channel = with nixpkgs.lib; {
|
||||
channel = with pkgs.lib; {
|
||||
nixpkgs = mkIf (nixpkgsChannelURL != null) nixpkgsChannelURL;
|
||||
nix-on-droid = mkIf (nixOnDroidChannelURL != null) nixOnDroidChannelURL;
|
||||
};
|
||||
|
|
@ -32,8 +39,8 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
callPackage = nixpkgs.lib.callPackageWith (
|
||||
nixpkgs // customPkgs // {
|
||||
callPackage = pkgs.lib.callPackageWith (
|
||||
pkgs // customPkgs // {
|
||||
inherit (modules) config;
|
||||
inherit callPackage nixpkgs nixDirectory initialPackageInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
let
|
||||
defaultNixpkgsArgs = {
|
||||
config = { };
|
||||
overlays = [ ];
|
||||
};
|
||||
|
||||
# head of nixos-22.05 as of 2022-06-27
|
||||
# note: when updating nixpkgs, update store paths of proot-termux in modules/environment/login/default.nix
|
||||
pinnedPkgsSrc = builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/cd90e773eae83ba7733d2377b6cdf84d45558780.tar.gz";
|
||||
sha256 = "1b2wn1ncx9x4651vfcgyqrm93pd7ghnrgqjbkf6ckkpidah69m03";
|
||||
};
|
||||
in
|
||||
|
||||
args: import pinnedPkgsSrc (args // defaultNixpkgsArgs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue