2011-07-25 02:45:52 +02:00
|
|
|
# Upower daemon.
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### 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 {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Upower, a DBus service that provides power
|
|
|
|
management support to applications.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
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
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
config = mkIf config.services.upower.enable {
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.upower ];
|
|
|
|
|
|
|
|
services.dbus.packages = [ pkgs.upower ];
|
|
|
|
|
2011-08-24 23:24:39 +02:00
|
|
|
services.udev.packages = [ pkgs.upower ];
|
|
|
|
|
2011-09-06 13:18:36 +02:00
|
|
|
system.activationScripts.upower =
|
|
|
|
''
|
|
|
|
mkdir -m 0755 -p /var/lib/upower
|
|
|
|
'';
|
|
|
|
|
2011-07-25 02:45:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|