-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpowerd.nix
39 lines (28 loc) · 814 Bytes
/
powerd.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ system, inputs, config, lib, pkgs, ... }:
with lib;
let
cfg = config.regolith.powerd;
in {
options.regolith.powerd = {
enable = mkEnableOption "Add regolith-powerd binary and services";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
(import ./regolith-powerd/default.nix { inherit pkgs; })
];
systemd.user.services.regolith-init-powerd = {
description = "Start Regolith Power Daemon";
partOf = [ "graphical-session.target" ];
wants = [ "gnome-session.target" ];
after = [ "gnome-session.target" ];
startLimitIntervalSec = 10;
startLimitBurst = 5;
serviceConfig = {
Type = "exec";
ExecStart = "regolith-powerd";
Restart = "on-failure";
};
wantedBy = [ "regolith-wayland.target" ];
};
};
}