what am i doing with my life

This commit is contained in:
Schrottkatze 2022-08-31 22:49:48 +02:00
parent 5bf4a00b13
commit c92fcd06f8
14 changed files with 228 additions and 11 deletions

View file

@ -0,0 +1,61 @@
{ config, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
# ./t2.nix
../common.nix
];
# boot.supportedFilesystems = pkgs.lib.mkForce [ "ext4" "btrfs" "squashfs" ];
# networking.wireless.enable = pkgs.lib.mkForce false;
# services.xserver.displayManager.autoLogin.user = pkgs.lib.mkForce "jade";
# users.users.jade = pkgs.lib.mkForce {
# isNormalUser = true;
# extraGroups = [ "wheel" "input" "uinput" "libvirtd" ];
# packages = with pkgs; [
# ];
# };
jade = {
desktop.enable = true;
desktop.compositing = true;
};
networking.hostName = "potatobook-g";
services.xserver.layout = "us";
services.xserver.xkbVariant = "altgr-intl";
hardware.bluetooth.enable = true;
hardware.keyboard.uhk.enable = true;
# missing: menu-qalc picom-jonaburg
environment.systemPackages = with pkgs; [
# TODO: clean up.
];
environment.pathsToLink = [
"/share/nix-direnv"
];
services.blueman.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.seahorse.enable = true;
security.pam.services.jade.enableGnomeKeyring = true;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# networking.firewall.allowedTCPPorts = [ 4713 ];
systemd.services."NetworkManager-wait-online".enable = false;
# release channel
system.stateVersion = "22.05"; # Did you read the comment?
}

Binary file not shown.

9
potatobook-g/iso.nix Normal file
View file

@ -0,0 +1,9 @@
{config, pkgs, ...}:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
./configuration.nix
];
}

View file

@ -0,0 +1,23 @@
{ 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

@ -0,0 +1,23 @@
{ 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

@ -0,0 +1,42 @@
{ 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 { }))

33
potatobook-g/t2.nix Normal file
View file

@ -0,0 +1,33 @@
{ 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" ];
}