mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
25 lines
987 B
Nix
25 lines
987 B
Nix
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
|
|
|
|
{ runCommand, nixDirectory, prootTermux, bash, pkgs, config, initialPackageInfo }:
|
|
|
|
runCommand "bootstrap" { } ''
|
|
mkdir --parents $out/{.l2s,bin,dev/shm,etc,root,tmp,usr/{bin,lib}}
|
|
mkdir --parents $out/nix/var/nix/{profiles,gcroots}/per-user/nix-on-droid
|
|
|
|
cp --recursive ${nixDirectory}/store $out/nix/store
|
|
cp --recursive ${nixDirectory}/var $out/nix/var
|
|
chmod --recursive u+w $out/nix
|
|
|
|
ln --symbolic ${initialPackageInfo.bash}/bin/sh $out/bin/sh
|
|
|
|
install -D -m 0755 ${prootTermux}/bin/proot-static $out/bin/proot-static
|
|
|
|
cp ${config.environment.files.login} $out/bin/login
|
|
cp ${config.environment.files.loginInner} $out/usr/lib/login-inner
|
|
|
|
${bash}/bin/bash ${../modules/environment/etc/setup-etc.sh} $out/etc ${config.build.activationPackage}/etc
|
|
|
|
cp --dereference --recursive $out/etc/static $out/etc/.static.tmp
|
|
rm $out/etc/static
|
|
mv $out/etc/.static.tmp $out/etc/static
|
|
''
|