Merge pull request #85907 from savannidgerinel/zenstates
ZenStates: init at 0.1.0
This commit is contained in:
commit
f3e8a97387
54
pkgs/os-specific/linux/zenstates/default.nix
Normal file
54
pkgs/os-specific/linux/zenstates/default.nix
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# Zenstates provides access to a variety of CPU tunables no Ryzen processors.
|
||||||
|
#
|
||||||
|
# In particular, I am adding Zenstates because I need it to disable the C6
|
||||||
|
# sleep state to stabilize wake from sleep on my Lenovo x395 system. After
|
||||||
|
# installing Zenstates, I need a before-sleep script like so:
|
||||||
|
#
|
||||||
|
# before-sleep = pkgs.writeScript "before-sleep" ''
|
||||||
|
# #!${pkgs.bash}/bin/bash
|
||||||
|
# ${pkgs.zenstates}/bin/zenstates --c6-disable
|
||||||
|
# '';
|
||||||
|
#
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# systemd.services.before-sleep = {
|
||||||
|
# description = "Jobs to run before going to sleep";
|
||||||
|
# serviceConfig = {
|
||||||
|
# Type = "oneshot";
|
||||||
|
# ExecStart = "${before-sleep}";
|
||||||
|
# };
|
||||||
|
# wantedBy = [ "sleep.target" ];
|
||||||
|
# before = [ "sleep.target" ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
{ stdenv, fetchFromGitHub, python3 }:
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "zenstates";
|
||||||
|
version = "0.0.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "r4m0n";
|
||||||
|
repo = "ZenStates-Linux";
|
||||||
|
rev = "0bc27f4740e382f2a2896dc1dabfec1d0ac96818";
|
||||||
|
sha256 = "1h1h2n50d2cwcyw3zp4lamfvrdjy1gjghffvl3qrp6arfsfa615y";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ python3 ];
|
||||||
|
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp $src/zenstates.py $out/bin/zenstates
|
||||||
|
chmod +x $out/bin/zenstates
|
||||||
|
patchShebangs --build $out/bin/zenstates
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Linux utility for Ryzen processors and motherboards";
|
||||||
|
homepage = "https://github.com/r4m0n/ZenStates-Linux";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ savannidgerinel ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
@ -26505,4 +26505,5 @@ in
|
|||||||
|
|
||||||
jitsi-meet-electron = callPackage ../applications/networking/instant-messengers/jitsi-meet-electron { };
|
jitsi-meet-electron = callPackage ../applications/networking/instant-messengers/jitsi-meet-electron { };
|
||||||
|
|
||||||
|
zenstates = callPackage ../os-specific/linux/zenstates {};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user