feat: use nixfmt

This commit is contained in:
2024-03-26 17:44:14 +01:00
parent 59e6ed992a
commit 3ad3491970
29 changed files with 444 additions and 558 deletions

View File

@@ -1,25 +1,19 @@
{
pkgs,
lib,
config,
...
}: let
cfg = config.hardware.gbmonctl;
in
with lib; {
options.hardware.gbmonctl = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mkDoc ''
Enables a CLI tool to change monitor settings over USB to the Gigabyte M32U
{ pkgs, lib, config, ... }:
let cfg = config.hardware.gbmonctl;
in with lib; {
options.hardware.gbmonctl = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mkDoc ''
Enables a CLI tool to change monitor settings over USB to the Gigabyte M32U
In theory any Gigabyte Monitor that uses a Realtek HID device (presumably the M28U also uses this) to control it over OSD sidekick should have the same protocol, but this is the only one I own.
'';
};
In theory any Gigabyte Monitor that uses a Realtek HID device (presumably the M28U also uses this) to control it over OSD sidekick should have the same protocol, but this is the only one I own.
'';
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [pkgs.gbmonctl];
services.udev.packages = [pkgs.gbmonctl];
};
}
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.gbmonctl ];
services.udev.packages = [ pkgs.gbmonctl ];
};
}

View File

@@ -1,13 +1,10 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.hardware.hid-fanatecff;
kernel = config.boot.kernelPackages.kernel;
fanatecKernelModule = pkgs.callPackage (import ./hid-fanatecff-module.nix) {kernel = kernel;};
fanatecKernelModule =
pkgs.callPackage (import ./hid-fanatecff-module.nix) { kernel = kernel; };
in {
options.hardware.hid-fanatecff = {
enable = mkOption {
@@ -23,8 +20,8 @@ in {
};
config = lib.mkIf cfg.enable {
boot = {
extraModulePackages = [fanatecKernelModule];
kernelModules = ["hid-fanatecff"];
extraModulePackages = [ fanatecKernelModule ];
kernelModules = [ "hid-fanatecff" ];
};
};
}

View File

@@ -1,9 +1,4 @@
{
lib,
stdenv,
kernel,
fetchFromGitHub,
}:
{ lib, stdenv, kernel, fetchFromGitHub, }:
stdenv.mkDerivation rec {
pname = "hid-fanatecff";
version = "0.1.0";
@@ -17,12 +12,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags =
kernel.makeFlags
++ [
"KVERSION=${kernel.modDirVersion}"
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
makeFlags = kernel.makeFlags ++ [
"KVERSION=${kernel.modDirVersion}"
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installFlags = [
"-C"
@@ -30,10 +23,11 @@ stdenv.mkDerivation rec {
"M=${src}"
"INSTALL_MOD_PATH=${placeholder "out"}"
];
installTargets = ["modules_install"];
installTargets = [ "modules_install" ];
meta = with lib; {
description = "Linux kernel driver that aims to add support for FANATEC devices";
description =
"Linux kernel driver that aims to add support for FANATEC devices";
homepage = "https://github.com/gotzl/hid-fanatecff";
license = licenses.gpl2Only;
platforms = platforms.linux;