mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Refactor directory structure
Benefits of this refactoring: - argument list is now comprehensibly as there is now only one nixpkgs version flying around - common config and lib functions got abstracted away - clearer intent when to use pinned or unpinned packages - allows better configurability for the future through config attr set
This commit is contained in:
parent
9e23547108
commit
4110def2ac
20 changed files with 163 additions and 209 deletions
|
|
@ -13,7 +13,7 @@ let
|
|||
in
|
||||
|
||||
{
|
||||
inherit (pkgs) proot;
|
||||
inherit (pkgs) proot-termux;
|
||||
|
||||
basic-environment = nixpkgs.buildEnv {
|
||||
name = "basic-environment";
|
||||
|
|
@ -23,7 +23,7 @@ in
|
|||
nixpkgs.cacert
|
||||
nixpkgs.coreutils
|
||||
nixpkgs.nix
|
||||
# pkgs.proot
|
||||
# pkgs.proot-termux
|
||||
pkgs.files.etc-group
|
||||
pkgs.files.etc-passwd
|
||||
pkgs.files.hm-install
|
||||
|
|
|
|||
|
|
@ -1,25 +1,24 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ arch
|
||||
, nixOnDroidChannelURL ? https://github.com/t184256/nix-on-droid-bootstrap/archive/testing.tar.gz
|
||||
, nixpkgsChannelURL ? https://nixos.org/channels/nixos-19.09
|
||||
, initialBuild ? true
|
||||
}:
|
||||
{ arch, initialBuild ? true, nixOnDroidChannelURL ? "https://github.com/t184256/nix-on-droid-bootstrap/archive/master.tar.gz" }:
|
||||
|
||||
assert builtins.elem arch [ "aarch64" "i686" ];
|
||||
|
||||
let
|
||||
pkgs = import <nixpkgs> { };
|
||||
currentNixpkgs = import <nixpkgs> { };
|
||||
currentNixpkgsLib = currentNixpkgs.callPackage ./lib { };
|
||||
|
||||
pkgsList = import ./pkgs-list.nix {
|
||||
inherit arch;
|
||||
inherit (pkgs) fetchFromGitHub;
|
||||
};
|
||||
pinnedNixpkgs = currentNixpkgsLib.loadNixpkgs { };
|
||||
pinnedNixpkgsLib = pinnedNixpkgs.callPackage ./lib { };
|
||||
|
||||
# use pinned nixpkgs only for initial build
|
||||
nixpkgs = if initialBuild then pinnedNixpkgs else currentNixpkgs;
|
||||
lib = if initialBuild then pinnedNixpkgsLib else currentNixpkgsLib;
|
||||
|
||||
config = lib.buildConfig { inherit arch initialBuild nixOnDroidChannelURL; };
|
||||
in
|
||||
|
||||
import ./pkgs {
|
||||
inherit arch initialBuild nixOnDroidChannelURL nixpkgsChannelURL;
|
||||
inherit (pkgsList) pinnedPkgs crossPkgs crossStaticPkgs;
|
||||
buildPkgs = if initialBuild then pkgsList.pinnedPkgs else pkgs;
|
||||
import ./pkgs/top-level/all-packages.nix {
|
||||
inherit nixpkgs lib config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ let
|
|||
in
|
||||
|
||||
{
|
||||
buildConfig = { arch, initialBuild, channelConfig ? { } }: (
|
||||
buildConfig = { arch, initialBuild, nixOnDroidChannelURL }: (
|
||||
{
|
||||
channel = {
|
||||
nix-on-droid = "https://github.com/t184256/nix-on-droid-bootstrap/archive/testing.tar.gz";
|
||||
nix-on-droid = nixOnDroidChannelURL;
|
||||
nixpkgs = "https://nixos.org/channels/nixos-19.09";
|
||||
} // channelConfig;
|
||||
};
|
||||
|
||||
core = {
|
||||
inherit arch initialBuild;
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ fetchFromGitHub, arch }:
|
||||
|
||||
let
|
||||
# head of nixos-19.09 as of 2019-10-14
|
||||
pinnedPkgsSrc = fetchFromGitHub {
|
||||
owner = "NixOS";
|
||||
repo = "nixpkgs";
|
||||
rev = "45a25ff41a2309099ff2e70b2f37debd5e567618";
|
||||
sha256 = "0w37p98i47d7snhckz8a3a60v0f05b5047vsm4rczink9mk9x7r3";
|
||||
};
|
||||
|
||||
defaultNixpkgsArgs = {
|
||||
config = { };
|
||||
overlays = [ ];
|
||||
};
|
||||
|
||||
pinnedPkgs = import pinnedPkgsSrc defaultNixpkgsArgs;
|
||||
|
||||
overlayJpegNoStatic = self: super: {
|
||||
inherit (pinnedPkgs) libjpeg;
|
||||
};
|
||||
|
||||
crossSystem = {
|
||||
config = "${arch}-unknown-linux-android";
|
||||
sdkVer = "24";
|
||||
ndkVer = "18b";
|
||||
useAndroidPrebuilt = true;
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
inherit pinnedPkgs;
|
||||
|
||||
crossPkgs = import pinnedPkgsSrc ({ inherit crossSystem; } // defaultNixpkgsArgs);
|
||||
|
||||
crossStaticPkgs = import pinnedPkgsSrc ({
|
||||
inherit crossSystem;
|
||||
|
||||
crossOverlays = [
|
||||
(import "${pinnedPkgsSrc}/pkgs/top-level/static.nix")
|
||||
overlayJpegNoStatic
|
||||
];
|
||||
} // defaultNixpkgsArgs);
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ arch, buildPkgs, crossPkgs, crossStaticPkgs, initialBuild, pinnedPkgs
|
||||
, nixOnDroidChannelURL, nixpkgsChannelURL
|
||||
} @ args:
|
||||
|
||||
let
|
||||
callPackage = buildPkgs.lib.callPackageWith (args // pkgs);
|
||||
|
||||
pkgs = rec {
|
||||
bootstrap = callPackage ./bootstrap.nix { };
|
||||
|
||||
bootstrapZip = callPackage ./bootstrap-zip.nix { };
|
||||
|
||||
files = callPackage ./files { } // { recurseForDerivations = true; };
|
||||
|
||||
ids = callPackage ./ids.nix { };
|
||||
|
||||
nixDirectory = callPackage ./nix-directory.nix { };
|
||||
|
||||
proot = callPackage ./proot.nix { };
|
||||
|
||||
qemuAarch64Static = callPackage ./qemu-aarch64-static.nix { };
|
||||
|
||||
talloc = callPackage ./talloc.nix { };
|
||||
};
|
||||
in
|
||||
|
||||
pkgs
|
||||
|
|
@ -1,32 +1,7 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ buildPkgs, initialBuild, nixDirectory
|
||||
, nixOnDroidChannelURL, nixpkgsChannelURL
|
||||
, ids }:
|
||||
|
||||
let
|
||||
instDir = "/data/data/com.termux.nix/files/usr";
|
||||
userName = "nix-on-droid";
|
||||
groupName = "nix-on-droid";
|
||||
shell = "/bin/sh";
|
||||
|
||||
packageInfo = import "${nixDirectory}/nix-support/package-info.nix";
|
||||
|
||||
# TODO: remove when https://github.com/NixOS/nixpkgs/pull/64421 got merged into stable
|
||||
writeTextDir = path: text: buildPkgs.writeTextFile {
|
||||
inherit text;
|
||||
name = builtins.baseNameOf path;
|
||||
destination = "/${path}";
|
||||
};
|
||||
|
||||
callPackage = buildPkgs.lib.callPackageWith (buildPkgs // {
|
||||
inherit initialBuild instDir packageInfo writeTextDir;
|
||||
inherit groupName userName ids;
|
||||
inherit shell;
|
||||
inherit nixOnDroidChannelURL nixpkgsChannelURL;
|
||||
});
|
||||
in
|
||||
{ callPackage, writeTextDir }:
|
||||
|
||||
{
|
||||
etc-group = callPackage ./etc-group.nix { };
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ writeTextDir, userName, groupName, ids }:
|
||||
{ config, writeTextDir }:
|
||||
|
||||
writeTextDir "etc/group" ''
|
||||
root:x:0:
|
||||
${groupName}:x:${(import ids).gid}:${userName}
|
||||
${config.user.group}:x:${config.user.gid}:${config.user.user}
|
||||
''
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ writeTextDir, instDir, userName, shell, ids }:
|
||||
|
||||
let
|
||||
idSet = import ids;
|
||||
in
|
||||
{ config, writeTextDir }:
|
||||
|
||||
writeTextDir "etc/passwd" ''
|
||||
root:x:0:0:System administrator:${instDir}/root:/bin/sh
|
||||
${userName}:x:${idSet.uid}:${idSet.gid}:${userName}:/data/data/com.termux.nix/files/home:${shell}
|
||||
root:x:0:0:System administrator:${config.core.installation}/root:/bin/sh
|
||||
${config.user.user}:x:${config.user.uid}:${config.user.gid}:${config.user.user}:${config.user.home}:${config.user.shell}
|
||||
''
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ coreutils, instDir, nix, writeScriptBin }:
|
||||
{ coreutils, nix, writeScriptBin }:
|
||||
|
||||
writeScriptBin "hm-install" ''
|
||||
#!/usr/bin/env sh
|
||||
|
|
|
|||
|
|
@ -1,53 +1,45 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ initialBuild
|
||||
, nixpkgsChannelURL, nixOnDroidChannelURL
|
||||
, instDir
|
||||
, packageInfo
|
||||
, writeTextDir
|
||||
}:
|
||||
{ config, lib, packageInfo, writeTextDir }:
|
||||
|
||||
writeTextDir "usr/lib/login-inner" ''
|
||||
set -e
|
||||
|
||||
[ "$#" -gt 0 ] || echo "Welcome to Nix-on-Droid!"
|
||||
|
||||
[ "$#" -gt 0 ] || echo "If nothing works, use the rescue shell and read ${instDir}/usr/lib/login-inner"
|
||||
[ "$#" -gt 0 ] || echo "If nothing works, use the rescue shell and read ${config.core.installation}/usr/lib/login-inner"
|
||||
[ "$#" -gt 0 ] || echo "If it does not help, report bugs at https://github.com/t184256/nix-on-droid-bootstrap/issues"
|
||||
|
||||
export USER='nix-on-droid'
|
||||
export HOME='/data/data/com.termux.nix/files/home'
|
||||
export USER="${config.user.user}"
|
||||
export HOME="${config.user.home}"
|
||||
|
||||
${
|
||||
if initialBuild
|
||||
then ''
|
||||
[ "$#" -gt 0 ] || echo "Sourcing Nix environment..."
|
||||
. ${packageInfo.nix}/etc/profile.d/nix.sh
|
||||
${lib.optionalString config.core.initialBuild ''
|
||||
[ "$#" -gt 0 ] || echo "Sourcing Nix environment..."
|
||||
. ${packageInfo.nix}/etc/profile.d/nix.sh
|
||||
|
||||
export NIX_SSL_CERT_FILE=${packageInfo.cacert}
|
||||
export NIX_SSL_CERT_FILE=${packageInfo.cacert}
|
||||
|
||||
echo "Installing and updating nix-channels..."
|
||||
${packageInfo.nix}/bin/nix-channel --add ${nixpkgsChannelURL} nixpkgs
|
||||
${packageInfo.nix}/bin/nix-channel --add ${nixOnDroidChannelURL} nix-on-droid
|
||||
${packageInfo.nix}/bin/nix-channel --update
|
||||
echo "Installing and updating nix-channels..."
|
||||
${packageInfo.nix}/bin/nix-channel --add ${config.channel.nixpkgs} nixpkgs
|
||||
${packageInfo.nix}/bin/nix-channel --add ${config.channel.nix-on-droid} nix-on-droid
|
||||
${packageInfo.nix}/bin/nix-channel --update
|
||||
|
||||
echo "Installing nix-on-droid.basic-environment..."
|
||||
${packageInfo.nix}/bin/nix-env -iA nix-on-droid.basic-environment
|
||||
echo "Installing nix-on-droid.basic-environment..."
|
||||
${packageInfo.nix}/bin/nix-env -iA nix-on-droid.basic-environment
|
||||
|
||||
echo "Setting up dynamic symlinks via nix-on-droid-linker"
|
||||
nix-on-droid-linker
|
||||
echo "Setting up dynamic symlinks via nix-on-droid-linker"
|
||||
nix-on-droid-linker
|
||||
|
||||
echo
|
||||
echo "Congratulations! Now you have Nix installed with some basic packages like"
|
||||
echo "bashInteractive, coreutils, cacert and some scripts provided by nix-on-droid"
|
||||
echo "itself."
|
||||
echo
|
||||
echo "You can go for the bare Nix setup or you can configure your phone via"
|
||||
echo "home-manager. For that simply run hm-install."
|
||||
echo
|
||||
'' else ""
|
||||
}
|
||||
echo
|
||||
echo "Congratulations! Now you have Nix installed with some basic packages like"
|
||||
echo "bashInteractive, coreutils, cacert and some scripts provided by nix-on-droid"
|
||||
echo "itself."
|
||||
echo
|
||||
echo "You can go for the bare Nix setup or you can configure your phone via"
|
||||
echo "home-manager. For that simply run hm-install."
|
||||
echo
|
||||
''}
|
||||
|
||||
[ "$#" -gt 0 ] || echo "Sourcing Nix environment..."
|
||||
. $HOME/.nix-profile/etc/profile.d/nix.sh
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ instDir, writeScriptBin }:
|
||||
{ config, writeScriptBin }:
|
||||
|
||||
let
|
||||
instDir = config.core.installation;
|
||||
in
|
||||
|
||||
writeScriptBin "login" ''
|
||||
#!/system/bin/sh
|
||||
|
|
@ -57,9 +61,7 @@ writeScriptBin "login" ''
|
|||
fi
|
||||
}
|
||||
|
||||
instDir=/data/data/com.termux.nix/files/usr
|
||||
|
||||
export USER=nix-on-droid
|
||||
export USER="${config.user.user}"
|
||||
export PROOT_TMP_DIR=${instDir}/tmp
|
||||
export PROOT_L2S_DIR=${instDir}/.l2s
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ buildPkgs }:
|
||||
|
||||
buildPkgs.runCommand "ids.nix" {} ''
|
||||
cat > $out <<EOF
|
||||
{
|
||||
gid = "$(${buildPkgs.coreutils}/bin/id -g)";
|
||||
uid = "$(${buildPkgs.coreutils}/bin/id -u)";
|
||||
}
|
||||
EOF
|
||||
''
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ arch, buildPkgs, bootstrap }:
|
||||
{ config, runCommand, zip, bootstrap }:
|
||||
|
||||
buildPkgs.runCommand "bootstrap-zip" { } ''
|
||||
runCommand "bootstrap-zip" { } ''
|
||||
mkdir $out
|
||||
cd ${bootstrap}
|
||||
${buildPkgs.zip}/bin/zip -q -9 -r $out/bootstrap-${arch} ./* ./.l2s
|
||||
${zip}/bin/zip -q -9 -r $out/bootstrap-${config.core.arch} ./* ./.l2s
|
||||
''
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ buildPkgs, files, nixDirectory, proot }:
|
||||
{ runCommand, files, nixDirectory, prootTermux }:
|
||||
|
||||
let
|
||||
packageInfo = import "${nixDirectory}/nix-support/package-info.nix";
|
||||
in
|
||||
|
||||
buildPkgs.runCommand "bootstrap" { } ''
|
||||
runCommand "bootstrap" { } ''
|
||||
mkdir --parents $out/{.l2s,bin,etc/nix,nix,root,tmp,usr/{bin,lib}}
|
||||
|
||||
cp --recursive ${nixDirectory}/store $out/nix/store
|
||||
|
|
@ -17,7 +17,7 @@ buildPkgs.runCommand "bootstrap" { } ''
|
|||
ln --symbolic --no-dereference ${packageInfo.bash}/bin/sh $out/bin/sh
|
||||
ln --symbolic --no-dereference ${packageInfo.coreutils}/bin/env $out/usr/bin/env
|
||||
|
||||
install -D -m 0755 ${proot}/bin/proot-static $out/bin/proot-static
|
||||
install -D -m 0755 ${prootTermux}/bin/proot-static $out/bin/proot-static
|
||||
|
||||
cp ${files.login}/bin/login $out/bin/login
|
||||
cp ${files.login-inner}/usr/lib/login-inner $out/usr/lib/login-inner
|
||||
30
src/pkgs/initial-build/cross-compiling/pkgs.nix
Normal file
30
src/pkgs/initial-build/cross-compiling/pkgs.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ config, lib, libjpeg, path }:
|
||||
|
||||
let
|
||||
overlayJpegNoStatic = self: super: {
|
||||
inherit libjpeg;
|
||||
};
|
||||
|
||||
crossSystem = {
|
||||
config = "${config.core.arch}-unknown-linux-android";
|
||||
sdkVer = "24";
|
||||
ndkVer = "18b";
|
||||
useAndroidPrebuilt = true;
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
cross = lib.loadNixpkgs { inherit crossSystem; };
|
||||
|
||||
crossStatic = lib.loadNixpkgs {
|
||||
inherit crossSystem;
|
||||
|
||||
crossOverlays = [
|
||||
(import "${path}/pkgs/top-level/static.nix")
|
||||
overlayJpegNoStatic
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,13 +1,17 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ pinnedPkgs, crossStaticPkgs, talloc }:
|
||||
{ callPackage, fetchFromGitHub, talloc }:
|
||||
|
||||
crossStaticPkgs.stdenv.mkDerivation rec {
|
||||
let
|
||||
pkgs = callPackage ./pkgs.nix { };
|
||||
in
|
||||
|
||||
pkgs.crossStatic.stdenv.mkDerivation {
|
||||
pname = "proot-termux";
|
||||
version = "unstable-2019-09-05";
|
||||
|
||||
src = pinnedPkgs.fetchFromGitHub {
|
||||
src = fetchFromGitHub {
|
||||
repo = "proot";
|
||||
owner = "termux";
|
||||
rev = "3ea655b1ae40bfa2ee612d45bf1e7ad97c4559f8";
|
||||
|
|
@ -1,23 +1,27 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ pinnedPkgs, crossPkgs }:
|
||||
{ callPackage, fetchurl, python2, zlib }:
|
||||
|
||||
crossPkgs.stdenv.mkDerivation rec {
|
||||
let
|
||||
pkgs = callPackage ./pkgs.nix { };
|
||||
in
|
||||
|
||||
pkgs.cross.stdenv.mkDerivation rec {
|
||||
name = "talloc-2.1.14";
|
||||
|
||||
src = pinnedPkgs.fetchurl {
|
||||
src = fetchurl {
|
||||
url = "mirror://samba/talloc/${name}.tar.gz";
|
||||
sha256 = "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di";
|
||||
};
|
||||
|
||||
depsBuildBuild = [ pinnedPkgs.python2 pinnedPkgs.zlib ];
|
||||
depsBuildBuild = [ python2 zlib ];
|
||||
|
||||
buildDeps = [ crossPkgs.zlib ];
|
||||
buildDeps = [ pkgs.cross.zlib ];
|
||||
|
||||
configurePhase = ''
|
||||
substituteInPlace buildtools/bin/waf \
|
||||
--replace "/usr/bin/env python" "${pinnedPkgs.python2}/bin/python"
|
||||
--replace "/usr/bin/env python" "${python2}/bin/python"
|
||||
./configure --prefix=$out \
|
||||
--disable-rpath \
|
||||
--disable-python \
|
||||
|
|
@ -32,7 +36,7 @@ crossPkgs.stdenv.mkDerivation rec {
|
|||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
make install
|
||||
${crossPkgs.stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc_[0-9]*.o
|
||||
${pkgs.cross.stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc_[0-9]*.o
|
||||
'';
|
||||
|
||||
fixupPhase = "";
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ arch, buildPkgs, qemuAarch64Static }:
|
||||
{ config, lib, stdenv, proot, qemuAarch64Static }:
|
||||
|
||||
let
|
||||
buildRootDirectory = "root-directory";
|
||||
filename = "nix-2.3.1-${arch}-linux.tar.xz.sha256";
|
||||
filename = "nix-2.3.1-${config.core.arch}-linux.tar.xz.sha256";
|
||||
|
||||
sha256 = buildPkgs.stdenv.mkDerivation {
|
||||
sha256 = stdenv.mkDerivation {
|
||||
name = "nix-installer-sha256";
|
||||
|
||||
src = builtins.fetchurl "https://nixos.org/releases/nix/nix-2.3.1/${filename}";
|
||||
|
|
@ -19,10 +19,10 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
prootCommand = buildPkgs.lib.concatStringsSep " " [
|
||||
"${buildPkgs.proot}/bin/proot"
|
||||
prootCommand = lib.concatStringsSep " " [
|
||||
"${proot}/bin/proot"
|
||||
(
|
||||
if arch == "aarch64"
|
||||
if config.core.arch == "aarch64"
|
||||
then "-q ${qemuAarch64Static}/bin/qemu-aarch64-static"
|
||||
else "-b /dev"
|
||||
)
|
||||
|
|
@ -31,13 +31,13 @@ let
|
|||
];
|
||||
in
|
||||
|
||||
buildPkgs.stdenv.mkDerivation {
|
||||
stdenv.mkDerivation {
|
||||
name = "nix-directory";
|
||||
|
||||
src = builtins.fetchurl {
|
||||
url = "https://nixos.org/releases/nix/nix-2.3.1/nix-2.3.1-${arch}-linux.tar.xz";
|
||||
url = "https://nixos.org/releases/nix/nix-2.3.1/nix-2.3.1-${config.core.arch}-linux.tar.xz";
|
||||
sha256 =
|
||||
if arch == "aarch64"
|
||||
if config.core.arch == "aarch64"
|
||||
then "94a6a525bd0b2df82e14b96b5b0eaae86669b5d4671aacfc4db2db85325a81c1"
|
||||
else "a5d3f26d4a449616bf654286f2fe29c1c1df4f029b7e29fa3ccf8494d598bfee"; # i686
|
||||
};
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ buildPkgs }:
|
||||
{ stdenv, config }:
|
||||
|
||||
buildPkgs.stdenv.mkDerivation {
|
||||
stdenv.mkDerivation {
|
||||
name = "qemu-aarch64-static";
|
||||
|
||||
src = builtins.fetchurl {
|
||||
42
src/pkgs/top-level/all-packages.nix
Normal file
42
src/pkgs/top-level/all-packages.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||
|
||||
{ config, lib, nixpkgs }:
|
||||
|
||||
let
|
||||
callPackage = nixpkgs.lib.callPackageWith (
|
||||
nixpkgs // pkgs // {
|
||||
inherit callPackage;
|
||||
|
||||
config = nixpkgs.config // config;
|
||||
|
||||
lib = nixpkgs.lib // lib;
|
||||
}
|
||||
);
|
||||
|
||||
pkgs = rec {
|
||||
|
||||
# files
|
||||
|
||||
files = callPackage ../files { } // { recurseForDerivations = true; };
|
||||
|
||||
# initial build
|
||||
|
||||
bootstrap = callPackage ../initial-build/bootstrap.nix { };
|
||||
|
||||
bootstrapZip = callPackage ../initial-build/bootstrap-zip.nix { };
|
||||
|
||||
nixDirectory = callPackage ../initial-build/nix-directory.nix { };
|
||||
|
||||
packageInfo = import "${nixDirectory}/nix-support/package-info.nix";
|
||||
|
||||
prootTermux = callPackage ../initial-build/cross-compiling/proot-termux.nix { };
|
||||
|
||||
qemuAarch64Static = callPackage ../initial-build/qemu-aarch64-static.nix { };
|
||||
|
||||
talloc = callPackage ../initial-build/cross-compiling/talloc.nix { };
|
||||
|
||||
};
|
||||
in
|
||||
|
||||
pkgs
|
||||
Loading…
Add table
Add a link
Reference in a new issue