From 2e4acbcf8bf5b155f4bfaa9f45ca6716aa494671 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Jul 2011 00:45:52 +0000 Subject: [PATCH] * Add a NixOS module for upower. svn path=/nixos/trunk/; revision=27931 --- modules/module-list.nix | 1 + modules/services/hardware/udisks.nix | 4 +-- modules/services/hardware/upower.nix | 38 ++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 modules/services/hardware/upower.nix diff --git a/modules/module-list.nix b/modules/module-list.nix index 369d942d7a6..d7fc7e2ec87 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -64,6 +64,7 @@ ./services/hardware/bluetooth.nix ./services/hardware/hal.nix ./services/hardware/udisks.nix + ./services/hardware/upower.nix ./services/hardware/pcscd.nix ./services/hardware/udev.nix ./services/logging/klogd.nix diff --git a/modules/services/hardware/udisks.nix b/modules/services/hardware/udisks.nix index 0b3dbe47d15..4a97dae7fa0 100644 --- a/modules/services/hardware/udisks.nix +++ b/modules/services/hardware/udisks.nix @@ -15,8 +15,8 @@ with pkgs.lib; enable = mkOption { default = false; description = '' - Whether to enable support for Udisks, a DBus service that - allows applications to query and manipulate storage devices. + Whether to enable Udisks, a DBus service that allows + applications to query and manipulate storage devices. ''; }; diff --git a/modules/services/hardware/upower.nix b/modules/services/hardware/upower.nix new file mode 100644 index 00000000000..c529e8b3cdb --- /dev/null +++ b/modules/services/hardware/upower.nix @@ -0,0 +1,38 @@ +# 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 ]; + + }; + +}