chore: format repo using treefmt-nix and nixfmt-rfc-style

This commit is contained in:
Andre 2025-06-04 12:11:03 -04:00
parent fc7c471412
commit 51e51e6014
266 changed files with 3721 additions and 2733 deletions

View file

@ -1,10 +1,21 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkDefault mkOption types versions;
inherit (lib)
mkDefault
mkOption
types
versions
;
# Set the version and hash for the kernel sources
srcVersion = with config.hardware.microsoft-surface;
srcVersion =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"6.12.19"
else if kernelVersion == "stable" then
@ -12,7 +23,8 @@ let
else
abort "Invalid kernel version: ${kernelVersion}";
srcHash = with config.hardware.microsoft-surface;
srcHash =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="
else if kernelVersion == "stable" then
@ -21,15 +33,17 @@ let
abort "Invalid kernel version: ${kernelVersion}";
# Set the version and hash for the linux-surface releases
pkgVersion = with config.hardware.microsoft-surface;
pkgVersion =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"6.12.7"
else if kernelVersion == "stable" then
"6.14.2"
else
abort "Invalid kernel version: ${kernelVersion}";
pkgHash = with config.hardware.microsoft-surface;
pkgHash =
with config.hardware.microsoft-surface;
if kernelVersion == "longterm" then
"sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="
else if kernelVersion == "stable" then
@ -38,28 +52,46 @@ let
abort "Invalid kernel version: ${kernelVersion}";
# Fetch the linux-surface package
repos = pkgs.callPackage ({ fetchFromGitHub, rev, hash }: {
linux-surface = fetchFromGitHub {
owner = "linux-surface";
repo = "linux-surface";
rev = rev;
hash = hash;
};
}) { hash = pkgHash; rev = "arch-${pkgVersion}-1"; };
repos =
pkgs.callPackage
(
{
fetchFromGitHub,
rev,
hash,
}:
{
linux-surface = fetchFromGitHub {
owner = "linux-surface";
repo = "linux-surface";
rev = rev;
hash = hash;
};
}
)
{
hash = pkgHash;
rev = "arch-${pkgVersion}-1";
};
# Fetch and build the kernel package
inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; }) linuxPackage surfacePatches;
inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; })
linuxPackage
surfacePatches
;
kernelPatches = surfacePatches {
version = pkgVersion;
patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix;
};
kernelPackages = linuxPackage {
inherit kernelPatches; version = srcVersion;
inherit kernelPatches;
version = srcVersion;
sha256 = srcHash;
ignoreConfigErrors=true;
ignoreConfigErrors = true;
};
in {
in
{
options.hardware.microsoft-surface.kernelVersion = mkOption {
description = "Kernel Version to use (patched for MS Surface)";
type = types.enum [