mirror of
https://codeberg.org/mart-w/nixos-x13s.git
synced 2024-11-15 03:54:47 +01:00
pd-mapper is now in-kernel
This commit is contained in:
parent
e6d95a3a60
commit
8e16dc9e6a
18
module.nix
18
module.nix
|
@ -41,27 +41,11 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [ pkgs.efibootmgr ];
|
||||||
pkgs.efibootmgr
|
|
||||||
(x13sPackages.uncompressed-firmware.override {
|
|
||||||
firmwareFilesList = lib.flatten options.hardware.firmware.definitions;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.pathsToLink = [ "/share/uncompressed-firmware" ];
|
|
||||||
|
|
||||||
hardware.enableAllFirmware = true;
|
hardware.enableAllFirmware = true;
|
||||||
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
|
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
|
||||||
|
|
||||||
systemd.services.pd-mapper = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${lib.getExe x13sPackages.pd-mapper}";
|
|
||||||
Restart = "always";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.efi.canTouchEfiVariables = true;
|
loader.efi.canTouchEfiVariables = true;
|
||||||
loader.systemd-boot.enable = lib.mkDefault true;
|
loader.systemd-boot.enable = lib.mkDefault true;
|
||||||
|
|
|
@ -21,10 +21,5 @@ rec {
|
||||||
defconfig = "johan_defconfig";
|
defconfig = "johan_defconfig";
|
||||||
};
|
};
|
||||||
|
|
||||||
pd-mapper = pkgs.callPackage ./pd-mapper { inherit qrtr; };
|
|
||||||
qrtr = pkgs.callPackage ./qrtr { };
|
|
||||||
|
|
||||||
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
|
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
|
||||||
|
|
||||||
uncompressed-firmware = pkgs.callPackage ./uncompressed-firmware.nix { };
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
stdenv,
|
|
||||||
lib,
|
|
||||||
fetchFromGitHub,
|
|
||||||
qrtr,
|
|
||||||
xz,
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "pd-mapper";
|
|
||||||
version = "unstable-2023-09-01";
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
qrtr
|
|
||||||
xz
|
|
||||||
];
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "andersson";
|
|
||||||
repo = "pd-mapper";
|
|
||||||
rev = "10997ba7c43a3787a40b6b1b161408033e716374";
|
|
||||||
hash = "sha256-qGrYNoPCxtdpTdbkSmB39+6/pSXml96Aul8b9opF9Lc=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [ ./pd-mapper-firmware-path.diff ];
|
|
||||||
|
|
||||||
installFlags = [ "prefix=$(out)" ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Qualcomm PD mapper";
|
|
||||||
homepage = "https://github.com/andersson/pd-mapper";
|
|
||||||
license = licenses.bsd3;
|
|
||||||
mainProgram = "pd-mapper";
|
|
||||||
platforms = platforms.aarch64;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
diff --git a/pd-mapper.c b/pd-mapper.c
|
|
||||||
index 65c4b80..669d9a0 100644
|
|
||||||
--- a/pd-mapper.c
|
|
||||||
+++ b/pd-mapper.c
|
|
||||||
@@ -194,7 +194,7 @@ static int pd_load_map(const char *file)
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef ANDROID
|
|
||||||
-#define FIRMWARE_BASE "/lib/firmware/"
|
|
||||||
+#define FIRMWARE_BASE "/run/current-system/sw/share/uncompressed-firmware/"
|
|
||||||
#else
|
|
||||||
#define FIRMWARE_BASE "/vendor/firmware/"
|
|
||||||
#endif
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
stdenv,
|
|
||||||
lib,
|
|
||||||
fetchFromGitHub,
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "qrtr";
|
|
||||||
version = "unstable-2023-01-17";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "andersson";
|
|
||||||
repo = "qrtr";
|
|
||||||
rev = "d0d471c96e7d112fac6f48bd11f9e8ce209c04d2";
|
|
||||||
hash = "sha256-KF0gCBRw3BDJdK1s+dYhHkokVTHwRFO58ho0IwHPehc=";
|
|
||||||
};
|
|
||||||
|
|
||||||
installFlags = [ "prefix=$(out)" ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "QMI IDL compiler";
|
|
||||||
homepage = "https://github.com/andersson/qrtr";
|
|
||||||
license = licenses.bsd3;
|
|
||||||
platforms = platforms.aarch64;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
{
|
|
||||||
runCommand,
|
|
||||||
buildEnv,
|
|
||||||
firmwareFilesList ? [ ],
|
|
||||||
}:
|
|
||||||
runCommand "qcom-modem-uncompressed-firmware-share"
|
|
||||||
{
|
|
||||||
firmwareFiles = buildEnv {
|
|
||||||
name = "qcom-modem-uncompressed-firmware";
|
|
||||||
paths = firmwareFilesList;
|
|
||||||
pathsToLink = [
|
|
||||||
"/lib/firmware/rmtfs"
|
|
||||||
"/lib/firmware/qcom"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
''
|
|
||||||
PS4=" $ "
|
|
||||||
(
|
|
||||||
set -x
|
|
||||||
mkdir -p $out/share/
|
|
||||||
ln -s $firmwareFiles/lib/firmware/ $out/share/uncompressed-firmware
|
|
||||||
)
|
|
||||||
''
|
|
Loading…
Reference in a new issue