mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 19:51:17 +00:00
Merge pull request #68037 from dtzWill/update/upower-0.99.11
upower: 0.99.10 -> 0.99.11
This commit is contained in:
commit
362c2f67f9
|
@ -5,8 +5,11 @@
|
|||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.upower;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
@ -49,55 +52,7 @@ in
|
|||
|
||||
services.udev.packages = [ cfg.package ];
|
||||
|
||||
systemd.services.upower =
|
||||
{ description = "Power Management Daemon";
|
||||
path = [ pkgs.glib.out ]; # needed for gdbus
|
||||
serviceConfig =
|
||||
{ Type = "dbus";
|
||||
BusName = "org.freedesktop.UPower";
|
||||
ExecStart = "@${cfg.package}/libexec/upowerd upowerd";
|
||||
Restart = "on-failure";
|
||||
# Upstream lockdown:
|
||||
# Filesystem lockdown
|
||||
ProtectSystem = "strict";
|
||||
# Needed by keyboard backlight support
|
||||
ProtectKernelTunables = false;
|
||||
ProtectControlGroups = true;
|
||||
ReadWritePaths = "/var/lib/upower";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
|
||||
# Network
|
||||
# PrivateNetwork=true would block udev's netlink socket
|
||||
RestrictAddressFamilies = "AF_UNIX AF_NETLINK";
|
||||
|
||||
# Execute Mappings
|
||||
MemoryDenyWriteExecute = true;
|
||||
|
||||
# Modules
|
||||
ProtectKernelModules = true;
|
||||
|
||||
# Real-time
|
||||
RestrictRealtime = true;
|
||||
|
||||
# Privilege escalation
|
||||
NoNewPrivileges = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.activationScripts.upower =
|
||||
''
|
||||
mkdir -m 0755 -p /var/lib/upower
|
||||
'';
|
||||
|
||||
# The upower daemon seems to get stuck after doing a suspend
|
||||
# (i.e. subsequent suspend requests will say "Sleep has already
|
||||
# been requested and is pending"). So as a workaround, restart
|
||||
# the daemon.
|
||||
powerManagement.resumeCommands =
|
||||
''
|
||||
${config.systemd.package}/bin/systemctl try-restart upower
|
||||
'';
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,53 +1,58 @@
|
|||
{ stdenv
|
||||
, fetchurl
|
||||
, pkgconfig
|
||||
, dbus-glib
|
||||
, intltool
|
||||
, libxslt
|
||||
, docbook_xsl
|
||||
, udev
|
||||
, libgudev
|
||||
, libusb1
|
||||
, glib
|
||||
, gobject-introspection
|
||||
, useSystemd ? true, systemd
|
||||
, gettext
|
||||
, systemd
|
||||
, useIMobileDevice ? true
|
||||
, libimobiledevice
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "upower";
|
||||
version = "0.99.10";
|
||||
version = "0.99.11";
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
src = fetchurl {
|
||||
url = https://gitlab.freedesktop.org/upower/upower/uploads/c438511024b9bc5a904f8775cfc8e4c4/upower-0.99.10.tar.xz;
|
||||
sha256 = "17d2bclv5fgma2y3g8bsn9pdvspn1zrzismzdnzfivc0f2wm28k4";
|
||||
url = https://gitlab.freedesktop.org/upower/upower/uploads/93cfe7c8d66ed486001c4f3f55399b7a/upower-0.99.11.tar.xz;
|
||||
sha256 = "1vxxvmz2cxb1qy6ibszaz5bskqdy9nd9fxspj9fv3gfmrjzzzdb4";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
docbook_xsl
|
||||
gettext
|
||||
gobject-introspection
|
||||
libxslt
|
||||
pkgconfig
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
dbus-glib
|
||||
intltool
|
||||
libxslt
|
||||
docbook_xsl
|
||||
udev
|
||||
libgudev
|
||||
libusb1
|
||||
gobject-introspection
|
||||
udev
|
||||
systemd
|
||||
]
|
||||
++ stdenv.lib.optional useSystemd systemd
|
||||
++ stdenv.lib.optional useIMobileDevice libimobiledevice
|
||||
;
|
||||
|
||||
propagatedBuildInputs = [
|
||||
glib
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--with-backend=linux"
|
||||
"--localstatedir=/var"
|
||||
]
|
||||
++ stdenv.lib.optional useSystemd [
|
||||
"--with-backend=linux"
|
||||
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
||||
"--with-systemdutildir=${placeholder "out"}/lib/systemd"
|
||||
"--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
|
||||
]
|
||||
;
|
||||
];
|
||||
|
||||
doCheck = false; # fails with "env: './linux/integration-test': No such file or directory"
|
||||
|
||||
|
|
Loading…
Reference in a new issue