mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 16:46:09 +00:00
eb6e1310b8
svn path=/nixos/trunk/; revision=29285
46 lines
677 B
Nix
46 lines
677 B
Nix
# Upower daemon.
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.upower = {
|
|
|
|
enable = mkOption {
|
|
default = false;
|
|
description = ''
|
|
Whether to enable Upower, a DBus service that provides power
|
|
management support to applications.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.services.upower.enable {
|
|
|
|
environment.systemPackages = [ pkgs.upower ];
|
|
|
|
services.dbus.packages = [ pkgs.upower ];
|
|
|
|
services.udev.packages = [ pkgs.upower ];
|
|
|
|
system.activationScripts.upower =
|
|
''
|
|
mkdir -m 0755 -p /var/lib/upower
|
|
'';
|
|
|
|
};
|
|
|
|
}
|