-
Notifications
You must be signed in to change notification settings - Fork 0
/
displayd.nix
64 lines (53 loc) · 1.75 KB
/
displayd.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ system, inputs, config, lib, pkgs, ... }:
with lib;
let
cfg = config.regolith.displayd;
in {
options.regolith.displayd = {
enable = mkEnableOption "Add regolith-displayd binary and services";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
(import ./regolith-displayd/default.nix { inherit pkgs; })
(import ./regolith-displayd/init.nix { inherit pkgs; })
# regolith-displayd-init
kanshi
killall
];
# https://github.com/regolith-linux/regolith-displayd/blob/96af6a84395930c03c0025891cf2c2553e963a00/debian/install
#kanshi-init-service
systemd.user.services.regolith-init-kanshi = {
description = "Start Kanshi for Regolith";
partOf = [ "graphical-session.target" ];
wants = [ "gnome-session.target" ];
after = [ "gnome-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "/run/current-system/sw/usr/bin/kanshi -c %h/.config/regolith3/kanshi/config";
Restart = "on-failure";
StartLimitIntervalSec = 10;
StartLimitBurst = 5;
};
};
#regolith-init-displayd
systemd.user.services.regolith-init-displayd = {
description = "Start Regolith Display Daemon";
partOf = [ "graphical-session.target" ];
wants = [ "gnome-session.target" ];
after = [ "gnome-session.target" ];
requires = [ "regolith-init-kanshi.service" ];
before = [ "regolith-init-kanshi.service" ];
startLimitIntervalSec = 30;
startLimitBurst = 5;
serviceConfig = {
Type = "dbus";
BusName = "org.gnome.Mutter.DisplayConfig";
ExecStartPre = "regolith-displayd-init";
ExecStart = "regolith-displayd";
Restart = "on-failure";
RestartSec = 5;
};
wantedBy = [ "regolith-wayland.target" ];
};
};
}