refactor!: restructure and document configuration

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-03-06 05:30:47 -03:00
parent 4a02e072a7
commit f87f9995be
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
126 changed files with 957 additions and 590 deletions

17
packages/README.md Normal file
View file

@ -0,0 +1,17 @@
## [zenergy](https://github.com/BoukeHaarsma23/zenergy/)
This is a kernel driver that adds the ability for user to fetch power draw data from AMD CPUs. I maintain it in
[nixpkgs], so you shouldn't use this package _unless_ it is broken in your current
version of [nixpkgs].
## wb32dfu-udev-rules
This package installs the udev rules necessary to allow flashing QMK/Vial onto keyboards that use WB32-DFU bootloaders.
It is also meant to be used in tandem with [NixOS] using the
[`services.udev.packages`](https://search.nixos.org/options?query=services.udev.packages) configuration.
<!-- REFERENCES -->
[nixpkgs]: https://github.com/NixOS/nixpkgs/
[nixos]: https://nixos.org

View file

@ -0,0 +1,19 @@
{
stdenv,
}:
stdenv.mkDerivation {
pname = "wb32dfu-udev-rules";
version = "0-unstable-2024-09-15";
src = ./.;
dontBuild = true;
installPhase = ''
runHook preInstall
install -D wb32dfu.rules $out/lib/udev/rules.d/50-wb32dfu.rules
runHook postInstall
'';
}

View file

@ -0,0 +1,2 @@
# WB32 DFU
SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess"

45
packages/zenergy.nix Normal file
View file

@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
kernel,
kmod,
}:
let
kernelDirectory = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
in
stdenv.mkDerivation {
pname = "zenergy";
version = "0-unstable-2024-10-10";
src = fetchFromGitHub {
owner = "BoukeHaarsma23";
repo = "zenergy";
rev = "7c4e83d5e2f887f4c31edaf92e5f94e9448e9764";
hash = "sha256-5fYelEr4IYnuXrly15IcyicFrF0tYjs7OBqIhUYQXZ0=";
};
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
hardeningDisable = [
"format"
"pic"
];
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernelDirectory}" ];
installTargets = [ "modules_install" ];
preBuild = ''
substituteInPlace Makefile --replace-fail "PWD modules_install" "PWD INSTALL_MOD_PATH=$out modules_install"
'';
meta = with lib; {
description = "Based on AMD_ENERGY driver, but with some jiffies added so non-root users can read it safely.";
homepage = "https://github.com/BoukeHaarsma23/zenergy";
license = licenses.gpl2Only;
maintainers = with maintainers; [ wizardlink ];
platforms = platforms.linux;
};
}