2011-07-25 02:45:52 +02:00
|
|
|
# Upower daemon.
|
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2011-07-25 02:45:52 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2011-07-25 02:45:52 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
let
|
2019-09-08 11:03:46 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
cfg = config.services.upower;
|
2019-09-08 11:03:46 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
in
|
2019-09-08 11:03:46 +02:00
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
options = {
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
services.upower = {
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
enable = mkOption {
|
2013-10-30 17:37:45 +01:00
|
|
|
type = types.bool;
|
2011-07-25 02:45:52 +02:00
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Upower, a DBus service that provides power
|
|
|
|
management support to applications.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.upower;
|
2016-01-17 19:34:55 +01:00
|
|
|
defaultText = "pkgs.upower";
|
2014-05-19 13:13:32 +02:00
|
|
|
example = lib.literalExample "pkgs.upower";
|
|
|
|
description = ''
|
|
|
|
Which upower package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
};
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
config = mkIf cfg.enable {
|
2011-07-25 02:45:52 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2011-07-25 02:45:52 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
services.dbus.packages = [ cfg.package ];
|
2011-07-25 02:45:52 +02:00
|
|
|
|
2014-05-19 13:13:32 +02:00
|
|
|
services.udev.packages = [ cfg.package ];
|
2011-08-24 23:24:39 +02:00
|
|
|
|
2019-09-08 11:03:46 +02:00
|
|
|
systemd.packages = [ cfg.package ];
|
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|