Remove reliance on nixpkgs
This commit is contained in:
parent
8d16acb191
commit
4d3fb33dec
7 changed files with 16 additions and 38 deletions
|
@ -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
BIN
prebuilt/armv7l-linux/busybox
Executable file
Binary file not shown.
1
prebuilt/armv7l-linux/cp
Symbolic link
1
prebuilt/armv7l-linux/cp
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
busybox
|
1
prebuilt/armv7l-linux/dirname
Symbolic link
1
prebuilt/armv7l-linux/dirname
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
busybox
|
1
prebuilt/armv7l-linux/echo
Symbolic link
1
prebuilt/armv7l-linux/echo
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
busybox
|
1
prebuilt/armv7l-linux/mkdir
Symbolic link
1
prebuilt/armv7l-linux/mkdir
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
busybox
|
1
prebuilt/armv7l-linux/mv
Symbolic link
1
prebuilt/armv7l-linux/mv
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
busybox
|
Loading…
Reference in a new issue