diff options
author | worldofpeace <worldofpeace@protonmail.ch> | 2019-09-08 08:14:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-08 08:14:35 -0400 |
commit | 362c2f67f9e24771f6634cec90111ab7992b5cfa (patch) | |
tree | 4b30b58345caccf95b543bfc34860584f32ebde7 /nixos | |
parent | 7e534e3eeb4ac4d786584467932efeb0c4d5669c (diff) | |
parent | 16083defb5aff18f70e938c6ecad1c9b11c3054a (diff) | |
download | nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.tar nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.tar.gz nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.tar.bz2 nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.tar.lz nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.tar.xz nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.tar.zst nixpkgs-362c2f67f9e24771f6634cec90111ab7992b5cfa.zip |
Merge pull request #68037 from dtzWill/update/upower-0.99.11
upower: 0.99.10 -> 0.99.11
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/hardware/upower.nix | 53 |
1 files changed, 4 insertions, 49 deletions
diff --git a/nixos/modules/services/hardware/upower.nix b/nixos/modules/services/hardware/upower.nix index 1da47349c07..5e7ac7a6e65 100644 --- a/nixos/modules/services/hardware/upower.nix +++ b/nixos/modules/services/hardware/upower.nix @@ -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 ]; }; |