This commit is contained in:
Schrottkatze 2022-09-02 15:48:40 +02:00
parent 1ecb6c30b3
commit a7565c8899
5 changed files with 3 additions and 121 deletions

View file

@ -95,6 +95,9 @@ in with lib; {
bars = [];
terminal = "kitty";
workspaceAutoBackAndForth = true;
focus = {
followMouse = false;
};
# Startup {{{
startup = [
# Keyboard remapping

View file

@ -1,23 +0,0 @@
{ stdenv, lib, fetchFromGitHub, kernel, kmod }:
stdenv.mkDerivation rec {
name = "apple-bce-${version}-${kernel.version}";
gitCommit = "f93c6566f98b3c95677de8010f7445fa19f75091";
version = "${gitCommit}";
src = fetchFromGitHub {
owner = "t2linux";
repo = "apple-bce-drv";
rev = "${gitCommit}";
sha256 = "sha256-5jvfDSa7tHp6z+E+RKIalNiLpsku1RNnKoJV2Ps8288=";
};
hardeningDisable = [ "pic" "format" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = [
"KERNELRELEASE=${kernel.modDirVersion}"
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=$(out)"
];
}

View file

@ -1,23 +0,0 @@
{ stdenv, lib, fetchFromGitHub, kernel, kmod }:
stdenv.mkDerivation rec {
name = "apple-ib-drv-${version}-${kernel.version}";
gitCommit = "d8411ad1d87db8491e53887e36c3d37f445203eb";
version = "${gitCommit}";
src = fetchFromGitHub {
owner = "t2linux";
repo = "apple-ib-drv";
rev = "${gitCommit}";
sha256 = "sha256-mPx9Y4488pcxnJ5iyeNRuWvnyluHXmOOBnRNw+GAC2k=";
};
hardeningDisable = [ "pic" "format" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = [
"KERNELRELEASE=${kernel.modDirVersion}"
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=$(out)"
];
}

View file

@ -1,42 +0,0 @@
{ pkgs, stdenv, lib, buildLinux, ... } @ args:
with lib;
let
kernelVersion = "5.18.16";
patches = pkgs.fetchFromGitHub {
owner = "Redecorating";
repo = "linux-t2-arch";
rev = "2222222222222222222222222222222222222222222222222222";
sha256 = "sha256-/gxnq0Gz/N1u6m/oes7a6NlJQ7CoMwnFNxztQhDt46Q=";
};
in
buildLinux (args // rec {
version = "${kernelVersion}-mbp";
modDirVersion = kernelVersion;
extraMeta.branch = versions.majorMinor version;
src = pkgs.fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${kernelVersion}.tar.xz";
sha256 = "sha256-8fWGJR5j3hTIbl+VuWvrFaBDTx5uId94jRI1ZK8NEc4=";
};
kernelPatches = [
#rec { name = "0001-arch-additions"; patch = "${patches}/${name}.patch"; }
#rec { name = "1001-Put-apple-bce-and-apple-ibridge-in-drivers-staging"; patch = "${patches}/${name}.patch"; }
#rec { name = "1002-add-modalias-to-apple-bce"; patch = "${patches}/${name}.patch"; }
rec { name = "2001-fix-acpica-for-zero-arguments-acpi-calls"; patch = "${patches}/${name}.patch"; }
rec { name = "2002-efi-Correct-Macmini-capitalisation-in-uefi-cert-quir"; patch = "${patches}/${name}.patch"; }
rec { name = "3001-applesmc-convert-static-structures-to-drvdata"; patch = "${patches}/${name}.patch"; }
rec { name = "3002-applesmc-make-io-port-base-addr-dynamic"; patch = "${patches}/${name}.patch"; }
rec { name = "3003-applesmc-switch-to-acpi_device-from-platform"; patch = "${patches}/${name}.patch"; }
rec { name = "3004-applesmc-key-interface-wrappers"; patch = "${patches}/${name}.patch"; }
rec { name = "3005-applesmc-basic-mmio-interface-implementation"; patch = "${patches}/${name}.patch"; }
rec { name = "3006-applesmc-fan-support-on-T2-Macs"; patch = "${patches}/${name}.patch"; }
rec { name = "3007-applesmc-Add-iMacPro-to-applesmc_whitelist"; patch = "${patches}/${name}.patch"; }
rec { name = "4001-Input-bcm5974-Add-support-for-the-T2-Macs"; patch = "${patches}/${name}.patch"; }
rec { name = "5001-Fix-for-touchbar"; patch = "${patches}/${name}.patch"; }
rec { name = "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h"; patch = "${patches}/${name}.patch"; }
rec { name = "8001-asahilinux-wifi-patchset"; patch = "${patches}/${name}.patch"; }
rec { name = "8002-asahilinux-hci_bcm4377-patchset"; patch = "${patches}/${name}.patch"; }
];
} // (args.argsOverride or { }))

View file

@ -1,33 +0,0 @@
{ pkgs, ... }:
let
in {
# from https://github.com/tpwrules/nixos-m1/blob/main/nix/m1-support/firmware/default.nix
nixpkgs.overlays = [ (self: super: {
linux-mbp = super.callPackage ./packages/linux-mbp { };
apple-bce = super.callPackage ./packages/apple-bce { kernel = self.linux-mbp; };
apple-ib-drv = super.callPackage ./packages/apple-ib-drv { kernel = self.linux-mbp; };
}) ];
hardware.firmware = [
(pkgs.stdenvNoCC.mkDerivation {
name = "firmware";
buildCommand = ''
mkdir -p $out/lib/firmware
FIRMWARE=`echo ${./.}/*firmware*.tar`
if [ -e "$FIRMWARE" ]; then
tar xf "$FIRMWARE" -C $out/lib/firmware
# move firmware for my specific device
mv $out/lib/firmware/C-4377__s-B3/* $out/lib/firmware
find $out/lib/firmware -depth -type d -empty -delete
else
# stop nixos infra from breaking when it doesn't have any firmware
touch $out/lib/firmware/.dummy
fi
'';
})
];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-mbp;
boot.extraModulePackages = [ pkgs.apple-bce pkgs.apple-ib-drv ];
boot.initrd.kernelModules = [ "apple_bce" "apple-ibridge" "apple-ib-tb" ];
}