1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

poweralertd: add module (#1951)

This commit is contained in:
Thibaut Marty 2021-04-27 22:38:41 +02:00 committed by GitHub
parent d4278212b5
commit 865e404826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

2
.github/CODEOWNERS vendored
View file

@ -225,6 +225,8 @@
/modules/services/playerctld.nix @fendse /modules/services/playerctld.nix @fendse
/tests/modules/playerctld @fendse /tests/modules/playerctld @fendse
/modules/services/poweralertd.nix @ThibautMarty
/modules/services/pulseeffects.nix @jonringer /modules/services/pulseeffects.nix @jonringer
/modules/services/random-background.nix @rycee /modules/services/random-background.nix @rycee

View file

@ -1906,6 +1906,14 @@ in
''; '';
} }
{
time = "2021-04-26T07:00:00+00:00";
condition = hostPlatform.isLinux;
message = ''
A new service is available: 'services.poweralertd'.
'';
}
]; ];
}; };
} }

View file

@ -181,6 +181,7 @@ let
(loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/polybar.nix { }) (loadModule ./services/polybar.nix { })
(loadModule ./services/poweralertd.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/random-background.nix { }) (loadModule ./services/random-background.nix { })
(loadModule ./services/redshift-gammastep/redshift.nix { }) (loadModule ./services/redshift-gammastep/redshift.nix { })

View file

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.poweralertd;
in {
meta.maintainers = [ maintainers.thibautmarty ];
options.services.poweralertd.enable =
mkEnableOption "the Upower-powered power alerterd";
config = mkIf cfg.enable {
systemd.user.services.poweralertd = {
Unit = {
Description = "UPower-powered power alerter";
Documentation = "man:poweralertd(1)";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
Type = "simple";
ExecStart = "${pkgs.poweralertd}/bin/poweralertd";
Restart = "always";
};
};
};
}