upower: add 0.99 version for gnome 3.12
This commit is contained in:
parent
819b5841c6
commit
df95a8cc2f
|
@ -4,6 +4,9 @@
|
|||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.upower;
|
||||
in
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
@ -21,6 +24,15 @@ with lib;
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.upower;
|
||||
example = lib.literalExample "pkgs.upower";
|
||||
description = ''
|
||||
Which upower package to use.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -28,13 +40,13 @@ with lib;
|
|||
|
||||
###### implementation
|
||||
|
||||
config = mkIf config.services.upower.enable {
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.upower ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
services.dbus.packages = [ pkgs.upower ];
|
||||
services.dbus.packages = [ cfg.package ];
|
||||
|
||||
services.udev.packages = [ pkgs.upower ];
|
||||
services.udev.packages = [ cfg.package ];
|
||||
|
||||
systemd.services.upower =
|
||||
{ description = "Power Management Daemon";
|
||||
|
@ -42,7 +54,7 @@ with lib;
|
|||
serviceConfig =
|
||||
{ Type = "dbus";
|
||||
BusName = "org.freedesktop.UPower";
|
||||
ExecStart = "@${pkgs.upower}/libexec/upowerd upowerd";
|
||||
ExecStart = "@${cfg.package}/libexec/upowerd upowerd";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ in {
|
|||
services.telepathy.enable = mkDefault true;
|
||||
networking.networkmanager.enable = true;
|
||||
services.upower.enable = config.powerManagement.enable;
|
||||
services.upower.package = gnome3.upower;
|
||||
|
||||
fonts.fonts = [ pkgs.dejavu_fonts ];
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ callPackage, self, pkgs }:
|
||||
|
||||
rec {
|
||||
inherit (pkgs) glib gtk2 gtk3 gnome2;
|
||||
inherit (pkgs) glib gtk2 gtk3 gnome2 upower;
|
||||
gtk = gtk3; # just to be sure
|
||||
libcanberra = pkgs.libcanberra_gtk3; # just to be sure
|
||||
inherit (pkgs.gnome2) ORBit2;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
rec {
|
||||
inherit (pkgs) glib gtk2 gtk3 gnome2;
|
||||
gnome3 = pkgs.gnome3_12;
|
||||
upower = pkgs.upower_99;
|
||||
gtk = gtk3; # just to be sure
|
||||
libcanberra = pkgs.libcanberra_gtk3; # just to be sure
|
||||
inherit (pkgs.gnome2) ORBit2;
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
{ stdenv, fetchurl, pkgconfig, glib, dbus, dbus_glib, dbus_tools, polkit
|
||||
, intltool, libxslt, docbook_xsl, udev, libusb1, pmutils
|
||||
, useSystemd ? true, systemd, gobjectIntrospection
|
||||
}:
|
||||
|
||||
assert stdenv.isLinux;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "upower-0.99.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://upower.freedesktop.org/releases/${name}.tar.xz";
|
||||
sha256 = "189rd8j5czy4fs7imxvr38icjh9vlgdz6ki2h08v530h96clndaz";
|
||||
};
|
||||
|
||||
buildInputs =
|
||||
[ dbus_glib polkit intltool libxslt docbook_xsl udev libusb1 gobjectIntrospection ]
|
||||
++ stdenv.lib.optional useSystemd systemd;
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
||||
preConfigure =
|
||||
''
|
||||
substituteInPlace src/linux/up-backend.c \
|
||||
--replace /usr/bin/pm- ${pmutils}/bin/pm- \
|
||||
--replace /usr/sbin/pm- ${pmutils}/sbin/pm-
|
||||
substituteInPlace src/notify-upower.sh \
|
||||
--replace /usr/bin/dbus-send ${dbus_tools}/bin/dbus-send
|
||||
'';
|
||||
|
||||
configureFlags =
|
||||
[ "--with-backend=linux" "--localstatedir=/var"
|
||||
"--enable-deprecated" # needed for Xfce (Nov 2013)
|
||||
]
|
||||
++ stdenv.lib.optional useSystemd
|
||||
[ "--enable-systemd"
|
||||
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
||||
"--with-systemdutildir=$(out)/lib/systemd/system-sleep"
|
||||
"--with-udevrulesdir=$(out)/lib/udev/rules.d"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_LINK = "-lgcc_s";
|
||||
|
||||
installFlags = "historydir=$(TMPDIR)/foo";
|
||||
|
||||
meta = {
|
||||
homepage = http://upower.freedesktop.org/;
|
||||
description = "A D-Bus service for power management";
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
|
@ -7544,6 +7544,8 @@ let
|
|||
|
||||
upower = callPackage ../os-specific/linux/upower { };
|
||||
|
||||
upower_99 = callPackage ../os-specific/linux/upower/0.99.nix { };
|
||||
|
||||
upstart = callPackage ../os-specific/linux/upstart { };
|
||||
|
||||
usbutils = callPackage ../os-specific/linux/usbutils { };
|
||||
|
|
Loading…
Reference in New Issue