Move files around...

- "kernel" and "repos.nix" --> "common/"
- "firmware/surface-go/ath10k" --> "surface-go/firmware/ath10k"
- Update where "kernel", "firmware/surface-go" and "repos.nix" can be found
This commit is contained in:
mexisme
2023-01-10 15:22:06 +13:00
parent ca29e25c39
commit 03df3d2d53
11 changed files with 18 additions and 7 deletions

View File

@@ -0,0 +1,26 @@
{ stdenv, lib, pkgs, firmwareLinuxNonfree, ... }:
let
repos = pkgs.callPackage ../../../common/repos.nix {};
killernetworking_firmware = repos.surface-go-ath10k-firmware_backup + "/K1535_Debian";
in stdenv.mkDerivation {
pname = "microsoft-surface-go-firmware-linux-nonfree";
inherit (firmwareLinuxNonfree) version;
src = firmwareLinuxNonfree;
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
# Install the Surface Go Wifi firmware:
cp ${killernetworking_firmware}/board.bin lib/firmware/ath10k/QCA6174/hw2.1/
cp ${killernetworking_firmware}/board.bin lib/firmware/ath10k/QCA6174/hw3.0/
mkdir $out; cp -r ./. $out
'';
meta = with lib; {
description = "Standard binary firmware collection, adjusted with the Surface Go WiFi firmware";
platforms = platforms.linux;
priority = 5;
};
}

View File

@@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkDefault mkEnableOption mkIf;
cfg = config.hardware.microsoft-surface.firmware.surface-go-ath10k;
in {
options = {
hardware.microsoft-surface.firmware.surface-go-ath10k = {
replace = mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.'';
};
};
config = mkIf cfg.replace {
hardware.enableAllFirmware = true;
hardware.firmware = [
(pkgs.callPackage ./ath10k-replace.nix {})
];
boot.extraModprobeConfig = mkDefault ''
options ath10k_core skip_otp=Y
'';
};
}