Update to a clearer directory-structure

This commit is contained in:
mexisme 2021-02-23 12:40:08 +13:00
parent 56f4b2df00
commit a9b2d0e3f1
5 changed files with 23 additions and 13 deletions

View file

@ -2,7 +2,7 @@
{
imports = [
./kernel
./firmware
./hardware_configuration.nix
./firmware/surface-go/ath10k
];
}

View file

@ -1,8 +0,0 @@
{ config, lib, pkgs, ... }:
{
hardware.enableAllFirmware = true;
hardware.firmware = [
# TODO: Wrap with an option:
(pkgs.callPackage ./ath10k.nix {})
];
}

View file

@ -1,8 +1,8 @@
{stdenv, lib, pkgs, firmwareLinuxNonfree, ...}:
let
repos = (pkgs.callPackage ../repos.nix {});
ath10k = ./ath10k;
# ath10k = repos.ath10k-firmware;
killernetworking_firmware = ./K1535_Debian;
# killernetworking_firmware = repos.ath10k-firmware;
in
firmwareLinuxNonfree.overrideAttrs (old: rec {
pname = "microsoft-surface-go-firmware-linux-nonfree";
@ -19,8 +19,8 @@ firmwareLinuxNonfree.overrideAttrs (old: rec {
rm -v $out/lib/firmware/ath10k/QCA6174/{hw2.1,hw3.0}/board-2.bin
# Install the Surface Go Wifi firmware:
cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw2.1/
cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw3.0/
cp ${killernetworking_firmware}/board.bin $out/lib/firmware/ath10k/QCA6174/hw2.1/
cp ${killernetworking_firmware}/board.bin $out/lib/firmware/ath10k/QCA6174/hw3.0/
'';
outputHash = "1nc56qii96dfvxnv3ad3lxz2rzyqcbldk0h9rbm3l2pgamkvj8dw";

View file

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