Remove reliance on nixpkgs
All checks were successful
Hydra bin0-bin.armv7l-linux Hydra build #1102 of bootstrap:bootstrap:bin0-bin.armv7l-linux
Hydra bin0.armv7l-linux Hydra build #1101 of bootstrap:bootstrap:bin0.armv7l-linux

This commit is contained in:
Charlotte 🦝 Delenk 2022-02-27 15:15:51 +01:00
parent 8d16acb191
commit 4d3fb33dec
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
7 changed files with 16 additions and 38 deletions

View file

@ -1,45 +1,18 @@
system: { nixpkgs, ... } @ args: rec { system: { nixpkgs, ... } @ args: rec {
pkgs = import nixpkgs { inherit system; };
inherit (builtins) toFile; inherit (builtins) toFile;
runCommandBasic = script: builtins.derivation {
inherit system;
name = "runCommandBasic";
builder = "${pkgs.busybox}/bin/sh";
args = [ (toFile "builder.sh" script) ];
};
writeTextFile =
{ name
, text
, executable ? false
, destination ? ""
, checkPhase ? ""
}: runCommandBasic ''
target=$out${destination}
mkdir -p "$(dirname "$target")"
if [ -e "$textPath" ]; then
mv "$textPath" "$target"
else
echo -n "$text" > "$target"
fi
eval "$checkPhase"
(test -n "$executable" && chmod +x "$target") || true
'';
writeText = name: text: writeTextFile { inherit name text; };
writeTextDir = path: text: writeTextFile {
inherit text;
name = builtins.baseNameOf path;
destination = "/${path}";
};
writeScript = name: text: writeTextFile { inherit name text; executable = true; };
writeScriptBin = name: text: writeTextFile { inherit name text; executable = true; destination = "/bin/${name}"; };
baseDerivation = { script, ... } @args: builtins.derivation (args // { baseDerivation = { script, ... } @args: builtins.derivation (args // {
inherit system; inherit system;
builder = "${pkgs.busybox}/bin/sh"; builder = ./. + "/../prebuilt/${system}/busybox";
args = [ (writeScript "${args.name}-builder.sh" script) ]; args = [
"sh"
(toFile "${args.name}-builder.sh" (
''
set -ex
export PATH=${./. + "/../prebuilt/${system}"}
eval "$script"
''
))
];
}); });
} }

BIN
prebuilt/armv7l-linux/busybox Executable file

Binary file not shown.

1
prebuilt/armv7l-linux/cp Symbolic link
View file

@ -0,0 +1 @@
busybox

View file

@ -0,0 +1 @@
busybox

1
prebuilt/armv7l-linux/echo Symbolic link
View file

@ -0,0 +1 @@
busybox

1
prebuilt/armv7l-linux/mkdir Symbolic link
View file

@ -0,0 +1 @@
busybox

1
prebuilt/armv7l-linux/mv Symbolic link
View file

@ -0,0 +1 @@
busybox