Max: Add wm2fc.

This commit is contained in:
Dmitry Voronin 2024-12-16 06:33:45 +03:00
parent 791389d0f2
commit 0b197aca6d
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,19 @@
{
__findFile,
pkgs,
...
}: let
wm2fc = pkgs.callPackage <package/wm2fc> {};
in {
environment.systemPackages = with pkgs; [
wm2fc
];
security.wrappers.wm2fc = {
source = "${wm2fc}/bin/wm2fc";
owner = "root";
group = "root";
setuid = true;
permissions = "u+rx,g+x,o+x";
};
}

28
package/wm2fc/default.nix Normal file
View file

@ -0,0 +1,28 @@
# SRC: https://github.com/matega/win-max-2-fan-control
{
autoPatchelfHook,
fetchFromGitHub,
lib,
stdenv,
}: stdenv.mkDerivation {
# dontUnpack = true;
name = "wm2fc";
src = fetchFromGitHub {
hash = "sha256-rU0n+4glTWHWjbvbc7Se0O53g1mVDwBP5SkH4ftwNWk=";
owner = "matega";
repo = "win-max-2-fan-control";
rev = "a9e65011e0b45d0a76fc5307ad2b7b585410dece";
};
installPhase = ''
runHook preInstall
install -Dm755 dist/Debug/GNU-Linux/winmax2fancontrol $out/bin/wm2fc
runHook postInstall
'';
meta = with lib; {
description = "GPD Win Max 2 Fan Control PoC";
license = licenses.gpl3;
mainProgram = "wm2fc";
meta.platforms = platforms.all;
};
}