-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
auto-cpufreq: 1.9.9 -> 2.2.0 #258684
auto-cpufreq: 1.9.9 -> 2.2.0 #258684
Changes from all commits
9596b22
35b0fdc
a6e0095
35ea9e8
b2077fb
d7e6e08
95a3b0d
0177e72
4d09b46
c5751ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
{ lib, python3Packages, fetchFromGitHub, substituteAll }: | ||
{ lib | ||
, python3Packages | ||
, fetchFromGitHub | ||
, substituteAll | ||
, wrapGAppsHook | ||
, gobject-introspection | ||
, gtk3 | ||
}: | ||
|
||
python3Packages.buildPythonPackage rec { | ||
# use pyproject.toml instead of setup.py | ||
format = "pyproject"; | ||
|
||
pname = "auto-cpufreq"; | ||
version = "1.9.9"; | ||
version = "2.2.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "AdnanHodzic"; | ||
repo = pname; | ||
repo = "auto-cpufreq"; | ||
rev = "v${version}"; | ||
sha256 = "sha256-D/5pwE2V+yXj92ECOUcl/dajMDbvVdz9YNJrl2Pzvts="; | ||
hash = "sha256-lwimP4+qRFNQN+uHSFJHdkXYREWGwtoEc7U+bN5TDcc="; | ||
}; | ||
|
||
propagatedBuildInputs = with python3Packages; [ setuptools-git-versioning click distro psutil ]; | ||
nativeBuildInputs = [ | ||
gobject-introspection | ||
wrapGAppsHook | ||
]; | ||
|
||
buildInputs = [ | ||
gtk3 | ||
python3Packages.poetry-core | ||
]; | ||
|
||
propagatedBuildInputs = with python3Packages; [ | ||
click | ||
distro | ||
psutil | ||
pygobject3 | ||
poetry-dynamic-versioning | ||
setuptools | ||
]; | ||
|
||
doCheck = false; | ||
pythonImportsCheck = [ "auto_cpufreq" ]; | ||
|
@@ -27,15 +54,41 @@ python3Packages.buildPythonPackage rec { | |
./prevent-install-and-copy.patch | ||
# patch to prevent update | ||
./prevent-update.patch | ||
]; | ||
]; | ||
|
||
postPatch = '' | ||
substituteInPlace auto_cpufreq/core.py --replace '/opt/auto-cpufreq/override.pickle' /var/run/override.pickle | ||
substituteInPlace scripts/org.auto-cpufreq.pkexec.policy --replace "/opt/auto-cpufreq/venv/bin/auto-cpufreq" $out/bin/auto-cpufreq | ||
|
||
substituteInPlace auto_cpufreq/gui/app.py auto_cpufreq/gui/objects.py \ | ||
--replace "/usr/local/share/auto-cpufreq/images/icon.png" $out/share/pixmaps/auto-cpufreq.png | ||
substituteInPlace auto_cpufreq/gui/app.py \ | ||
--replace "/usr/local/share/auto-cpufreq/scripts/style.css" $out/share/auto-cpufreq/scripts/style.css | ||
|
||
''; | ||
|
||
postInstall = '' | ||
# copy script manually | ||
cp ${src}/scripts/cpufreqctl.sh $out/bin/cpufreqctl.auto-cpufreq | ||
|
||
# copy css file | ||
mkdir -p $out/share/auto-cpufreq/scripts | ||
cp scripts/style.css $out/share/auto-cpufreq/scripts/style.css | ||
|
||
|
||
# systemd service | ||
mkdir -p $out/lib/systemd/system | ||
cp ${src}/scripts/auto-cpufreq.service $out/lib/systemd/system | ||
|
||
# desktop icon | ||
mkdir -p $out/share/applications | ||
mkdir $out/share/pixmaps | ||
cp scripts/auto-cpufreq-gtk.desktop $out/share/applications | ||
cp images/icon.png $out/share/pixmaps/auto-cpufreq.png | ||
|
||
# polkit policy | ||
mkdir -p $out/share/polkit-1/actions | ||
cp scripts/org.auto-cpufreq.pkexec.policy $out/share/polkit-1/actions | ||
''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a specific NixOS module for this ? I guess just enabling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, auto-cpufreq usually runs as a daemon/background process, so just installing the package should only provide the binaries etc. I like that it's a service. Also, the autocpufreq-service clashes with gnome3's power management (even with the service, sadly), so automatically running the service after installing the package would maybe also not be super nice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My question was merely how to make sure that the polkit policy is correctly used. As an example using custom Do we need to do something similar with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok, sorry, then I got the question wrong, can't help in this case 🙈 |
||
|
||
meta = with lib; { | ||
|
This comment was marked as resolved.
Sorry, something went wrong.