forked from nikkuss/pkgs
base testing
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
newScope,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
...
|
||||
}:
|
||||
let
|
||||
src = fetchFromGitHub {
|
||||
owner = "qca";
|
||||
repo = "qca-swiss-army-knife";
|
||||
rev = "7c191e5530d32391105653b276ab587d2af9e02a";
|
||||
hash = "sha256-iE4lqyr3zmLcgFnsrDvQ/CKUV15ijqmIbUIs9sgMECg=";
|
||||
};
|
||||
in
|
||||
lib.packagesFromDirectoryRecursive {
|
||||
inherit callPackage newScope;
|
||||
directory = ./tools;
|
||||
}
|
||||
# lib.makeScope newScope (self: {
|
||||
# ath12k-tools = self.callPackage ./ath12k-tools.nix { inherit src; };
|
||||
# })
|
||||
@@ -0,0 +1,14 @@
|
||||
{ src, python3, ... }:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
name = "ath12k-tools";
|
||||
pyproject = false;
|
||||
inherit src;
|
||||
sourceRoot = "source/tools/scripts/ath12k";
|
||||
installPhase = ''
|
||||
install -Dm755 "ath12k-bdencoder" "$out/bin/ath12k-bdencoder"
|
||||
install -Dm755 "ath12k-check" "$out/bin/ath12k-check"
|
||||
install -Dm755 "ath12k-fw-repo" "$out/bin/ath12k-fw-repo"
|
||||
install -Dm755 "ath12k-fwencoder" "$out/bin/ath12k-fwencoder"
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
msitools,
|
||||
tree,
|
||||
fetchurl,
|
||||
lib,
|
||||
stdenv,
|
||||
...
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (
|
||||
let
|
||||
fw_files = [
|
||||
"adsp_dtbs.elf"
|
||||
"adspr.jsn"
|
||||
"adsps.jsn"
|
||||
"adspua.jsn"
|
||||
"battmgr.jsn"
|
||||
"cdsp_dtbs.elf"
|
||||
"cdspr.jsn"
|
||||
"qcadsp8380.mbn"
|
||||
"qccdsp8380.mbn"
|
||||
"qcdxkmsuc8380.mbn"
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
name = "x1e80100-firmware";
|
||||
src = fetchurl {
|
||||
url = "https://download.microsoft.com/download/b7ca2c3f-d320-4795-be0f-529a0117abb4/SurfaceLaptop7_ARM_Win11_26100_25.061.7304.0.msi";
|
||||
sha256 = "sha256-x75NsuZZr64XfGhjghIoiymdhhb/rM0iaV9EohwPbrs=";
|
||||
};
|
||||
nativeBuildInputs = [
|
||||
msitools
|
||||
tree
|
||||
];
|
||||
unpackPhase = ''
|
||||
msiextract -C . $src
|
||||
'';
|
||||
buildPhase = ''
|
||||
mkdir -p $out/lib/firmware/qcom/x1e80100/microsoft/Romulus
|
||||
for file in ${lib.concatStringsSep " " fw_files}; do
|
||||
echo -e "\tSearching for $file..."
|
||||
fw_path=$(find . -type f -name "$file" -print | head -n 1)
|
||||
if [[ -n "$fw_path" ]]; then
|
||||
cp -v "$fw_path" "$out/lib/firmware/qcom/x1e80100/microsoft/Romulus/"
|
||||
else
|
||||
echo "Error: $file not found!"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
cp $out/lib/firmware/qcom/x1e80100/microsoft/Romulus/qcdxkmsuc8380.mbn $out/lib/firmware/qcom/x1e80100/microsoft/qcdxkmsuc8380.mbn
|
||||
'';
|
||||
meta = {
|
||||
platforms = [ "aarch64-linux" ];
|
||||
};
|
||||
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
prev: final:
|
||||
builtins.listToAttrs (
|
||||
map (fn: {
|
||||
name = fn;
|
||||
value = prev.callPackage ./${fn} { };
|
||||
}) (builtins.filter (fn: fn != "default.nix") (builtins.attrNames (builtins.readDir ./.)))
|
||||
)
|
||||
Reference in New Issue
Block a user