Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works on Acer Predator Helios Neo 16 (PHN16-71) + Package for nix! #60

Open
itm154 opened this issue Aug 31, 2024 · 3 comments
Open

Works on Acer Predator Helios Neo 16 (PHN16-71) + Package for nix! #60

itm154 opened this issue Aug 31, 2024 · 3 comments

Comments

@itm154
Copy link

itm154 commented Aug 31, 2024

Works fine on my Helios even with NixOS. For anyone who's using it here's the package, you may need to change some things. You also might want to use the acer-predator-turbo-and-rgb-keyboard-linux-module (with nix)

./packages/acer-wmi-battery/default.nix

{
  stdenv,
  lib,
  fetchFromGitHub,
  pkgs,
  kernel ? pkgs.linuxPackages_zen.kernel, # You might need to change this depending on the kernel you're using
  kmod,
}:
stdenv.mkDerivation rec {
  name = "acer-wmi-battery-${version}-${kernel.version}";
  version = "0.1.0";

  src = fetchFromGitHub {
    owner = "frederik-h";
    repo = "acer-wmi-battery";
    rev = "v${version}";
    sha256 = "0b8h4qgqdgmzmzb2hvsh4psn3d432klxdfkjsarpa89iylr4irfs";
  };

  setSourceRoot = ''export sourceRoot=$(pwd)/source'';
  nativeBuildInputs = kernel.moduleBuildDependencies;

  makeFlags =
    kernel.makeFlags
    ++ [
      "-C"
      "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
      "M=$(sourceRoot)"
    ];
  buildFlags = ["modules"];
  installFlags = ["INSTALL_MOD_PATH=${placeholder "out"}"];
  installTargets = ["modules_install"];

  meta = with lib; {
    description = "A linux kernel driver for the Acer WMI battery health control interface";
    homepage = "https://github.com/frederik-h/acer-wmi-battery";
    license = licenses.gpl2;
    maintainers = [maintainers.itm154];
    platforms = platforms.linux;
  };
}

./{your nixos/hardware config}

{
  config,
  lib,
  pkgs,
  modulesPath,
  ...
}: let
. . .
# Im using snowfall-lib here so you might need to change this to use callpackage
# acer-wmi-battery = config.boot.kernelPackages.callPackage ./acer-wmi-battery.nix {};
  acer-wmi-battery = pkgs.custom.acer-wmi-battery; 
. . .
in {
. . .
# Dont forget to include these
  boot.extraModulePackages = [acer-wmi-battery];
  boot.kernelModules = ["wmi" "acer-wmi-battery"];
. . .
}

Then you can use the commands from the instructions
echo 1 | sudo tee /sys/bus/wmi/drivers/acer-wmi-battery/health_mode etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@itm154 and others