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

power-profiles-daemon: init at 0.1, add service module #97972

Merged
merged 2 commits into from Feb 9, 2021

Conversation

mvnetbiz
Copy link
Contributor

@mvnetbiz mvnetbiz commented Sep 14, 2020

Motivation for this change

Adds user selected power profile handling through DBus daemon.
nixpkgs issue #97714

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@mvnetbiz mvnetbiz changed the title Power profiles daemon power-profiles-daemon: init at 0.1, add service module Sep 14, 2020
@mvnetbiz
Copy link
Contributor Author

@jtojnar It doesn't seem to build man pages, but I think that is broken upstream. It also looks like it builds gtk-doc but that directory gets removed in the fixup phase? Maybe there is something wrong with the expression, I don't know how to debug that.

@jtojnar
Copy link
Contributor

jtojnar commented Sep 14, 2020

Multiple-outputs hook moves gtk-doc to devdoc output, or to /dev/null if the former is not available. Add outputs = [ "out" "devdoc" ]; between version and src attributes.

It does not look like there are man pages, the command for generating them is not invoked by anything: https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/blob/7b5321131a7516e1e309f48357fffa2ae909863d/docs/meson.build#L48-60

@mvnetbiz
Copy link
Contributor Author

Thanks. I just did these fixes locally, I didn't know about GitHub's "Commit suggestion," it looks like it credits the commenter, is that the preferred approach? Also, this PR should wait until integration into gnome shell is released, since there is no UI for it right?

@jtojnar
Copy link
Contributor

jtojnar commented Sep 14, 2020

For trivial fixes like these, attribution is not necessary (and the extra commits will be squashed onto the original commit anyway).

Merging this is fine just for coverage. And it might be usefult if someone wants to control this using D-Bus or by applying the g-c-c patches to their system.

@mvnetbiz mvnetbiz marked this pull request as ready for review September 14, 2020 13:31
@mvnetbiz mvnetbiz force-pushed the power-profiles-daemon branch 2 times, most recently from 9d12ceb to 6b0f760 Compare September 15, 2020 08:16
@mvnetbiz
Copy link
Contributor Author

Added nixos test, should I squash commits?

@jtojnar
Copy link
Contributor

jtojnar commented Sep 15, 2020

I would say either is fine. As long as the individual commits evaluate they are okay.

@jtojnar jtojnar self-assigned this Feb 9, 2021
@jtojnar
Copy link
Contributor

jtojnar commented Feb 9, 2021

Sorry, I forgot about this, should be good to go. Will merge once the CI succeeds.

@jtojnar jtojnar merged commit faf133f into NixOS:master Feb 9, 2021
@siraben
Copy link
Member

siraben commented Feb 9, 2021

One occurrence of stdenv.lib got through.

Closed by #112507

@LEXUGE
Copy link
Contributor

LEXUGE commented Apr 17, 2021

{ assertion = !config.services.tlp.enable;

I feel this is problematic, because regardless whether user enabled power-profiles-daemon or not, if they use tlp, the assertion fails

@jtojnar
Copy link
Contributor

jtojnar commented Apr 17, 2021

Should not that assertion being in mkIf cfg.enable make it only trigger when user enabled p-p-d?

@mvnetbiz
Copy link
Contributor Author

I'm still using TLP on my laptop since this commit, so must be something else going on if you are having a problem.

@srid
Copy link
Contributor

srid commented May 7, 2021

I just hit this,

❯ sudo nixos-rebuild switch
warning: Git tree '/etc/nixos' is dirty
warning: updating lock file '/etc/nixos/flake.lock':
* Updated 'nixpkgs': 'github:nixos/nixpkgs/1c16013bd6e94da748b41cc123c6b509a23eb440' -> 'github:nixos/nixpkgs/9468b073267c9159d79b89686fabd09367f74ac3'
warning: Git tree '/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
error:
       Failed assertions:
       - You have set services.power-profiles-daemon.enable = true;
       which conflicts with services.tlp.enable = true;

The tlp setting seems to be coming from https://github.com/NixOS/nixos-hardware which I use.

mvnetbiz referenced this pull request May 8, 2021
GNOME 40 added support for it in Control Center.
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/cant-enable-tlp-when-upgrading-to-21-05/13435/4

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

Successfully merging this pull request may close these issues.

None yet

7 participants