mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 16:45:51 +03:00
power-profiles-daemon: init at 0.1, add service module
This commit is contained in:
parent
4ab8d1f13d
commit
9a3190a960
@ -374,6 +374,7 @@
|
|||||||
./services/hardware/nvidia-optimus.nix
|
./services/hardware/nvidia-optimus.nix
|
||||||
./services/hardware/pcscd.nix
|
./services/hardware/pcscd.nix
|
||||||
./services/hardware/pommed.nix
|
./services/hardware/pommed.nix
|
||||||
|
./services/hardware/power-profiles-daemon.nix
|
||||||
./services/hardware/ratbagd.nix
|
./services/hardware/ratbagd.nix
|
||||||
./services/hardware/sane.nix
|
./services/hardware/sane.nix
|
||||||
./services/hardware/sane_extra_backends/brscan4.nix
|
./services/hardware/sane_extra_backends/brscan4.nix
|
||||||
|
53
nixos/modules/services/hardware/power-profiles-daemon.nix
Normal file
53
nixos/modules/services/hardware/power-profiles-daemon.nix
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.power-profiles-daemon;
|
||||||
|
package = pkgs.power-profiles-daemon;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.power-profiles-daemon = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to enable power-profiles-daemon, a DBus daemon that allows
|
||||||
|
changing system behavior based upon user-selected power profiles.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
assertions = [
|
||||||
|
{ assertion = !config.services.tlp.enable;
|
||||||
|
message = ''
|
||||||
|
You have set services.power-profiles-daemon.enable = true;
|
||||||
|
which conflicts with services.tlp.enable = true;
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
services.dbus.packages = [ package ];
|
||||||
|
|
||||||
|
services.udev.packages = [ package ];
|
||||||
|
|
||||||
|
systemd.packages = [ package ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
66
pkgs/os-specific/linux/power-profiles-daemon/default.nix
Normal file
66
pkgs/os-specific/linux/power-profiles-daemon/default.nix
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, pkg-config
|
||||||
|
, meson
|
||||||
|
, ninja
|
||||||
|
, fetchFromGitLab
|
||||||
|
, libgudev
|
||||||
|
, glib
|
||||||
|
, gobject-introspection
|
||||||
|
, gettext
|
||||||
|
, gtk-doc
|
||||||
|
, docbook-xsl-nons
|
||||||
|
, docbook_xml_dtd_412
|
||||||
|
, libxml2
|
||||||
|
, libxslt
|
||||||
|
, upower
|
||||||
|
, systemd
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "power-profiles-daemon";
|
||||||
|
version = "0.1";
|
||||||
|
|
||||||
|
outputs = [ "out" "devdoc" ];
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
domain = "gitlab.freedesktop.org";
|
||||||
|
owner = "hadess";
|
||||||
|
repo = "power-profiles-daemon";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "012w3aryw5d43dr9jj5i6wy2a0n21jidr4ggs9ix7d4z9byr175w";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkg-config
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
gettext
|
||||||
|
gtk-doc
|
||||||
|
docbook-xsl-nons
|
||||||
|
docbook_xml_dtd_412
|
||||||
|
libxml2 # for xmllint for stripping GResources
|
||||||
|
libxslt # for xsltproc for building docs
|
||||||
|
gobject-introspection
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
libgudev
|
||||||
|
systemd
|
||||||
|
upower
|
||||||
|
glib
|
||||||
|
];
|
||||||
|
|
||||||
|
mesonFlags = [
|
||||||
|
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
||||||
|
"-Dgtk_doc=true"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://gitlab.freedesktop.org/hadess/power-profiles-daemon";
|
||||||
|
description = "Makes user-selected power profiles handling available over D-Bus";
|
||||||
|
platforms = platforms.linux;
|
||||||
|
license = licenses.gpl3Plus;
|
||||||
|
maintainers = with maintainers; [ mvnetbiz ];
|
||||||
|
};
|
||||||
|
}
|
@ -7173,6 +7173,8 @@ in
|
|||||||
|
|
||||||
povray = callPackage ../tools/graphics/povray { };
|
povray = callPackage ../tools/graphics/povray { };
|
||||||
|
|
||||||
|
power-profiles-daemon = callPackage ../os-specific/linux/power-profiles-daemon { };
|
||||||
|
|
||||||
ppl = callPackage ../development/libraries/ppl { };
|
ppl = callPackage ../development/libraries/ppl { };
|
||||||
|
|
||||||
pplatex = callPackage ../tools/typesetting/tex/pplatex { };
|
pplatex = callPackage ../tools/typesetting/tex/pplatex { };
|
||||||
|
Loading…
Reference in New Issue
Block a user