summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/desktops
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-08-24 19:22:59 +0530
committertomf <tom@tom-fitzhenry.me.uk>2023-11-23 13:50:14 +1100
commit9796cbb02175622a5576d53cd340d8e25a6944bc (patch)
tree14ffc6dfda26c6ed052ce3ab3f29eebca228892f /nixos/modules/services/desktops
parent8be0176e7c5b41595e7d9f3e5df50226dcba8521 (diff)
nixos/seatd: init
Diffstat (limited to 'nixos/modules/services/desktops')
-rw-r--r--nixos/modules/services/desktops/seatd.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixos/modules/services/desktops/seatd.nix b/nixos/modules/services/desktops/seatd.nix
new file mode 100644
index 000000000000..32fff587ab3c
--- /dev/null
+++ b/nixos/modules/services/desktops/seatd.nix
@@ -0,0 +1,49 @@
+{ config, lib, pkgs, ... }:
+
+let
+ cfg = config.services.seatd;
+ inherit (lib) mkEnableOption mkOption mdDoc types;
+in
+{
+ meta.maintainers = with lib.maintainers; [ sinanmohd ];
+
+ options.services.seatd = {
+ enable = mkEnableOption (mdDoc "seatd");
+
+ user = mkOption {
+ type = types.str;
+ default = "root";
+ description = mdDoc "User to own the seatd socket";
+ };
+ group = mkOption {
+ type = types.str;
+ default = "seat";
+ description = mdDoc "Group to own the seatd socket";
+ };
+ logLevel = mkOption {
+ type = types.enum [ "debug" "info" "error" "silent" ];
+ default = "info";
+ description = mdDoc "Logging verbosity";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [ seatd ];
+ users.groups.seat = lib.mkIf (cfg.group == "seat") {};
+
+ systemd.services.seatd = {
+ description = "Seat management daemon";
+ documentation = [ "man:seatd(1)" ];
+
+ wantedBy = [ "multi-user.target" ];
+ restartIfChanged = false;
+
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = "${pkgs.seatd.bin}/bin/seatd -u ${cfg.user} -g ${cfg.group} -l ${cfg.logLevel}";
+ RestartSec = 1;
+ Restart = "always";
+ };
+ };
+ };
+}