nixos/seatd: init

This commit is contained in:
sinanmohd 2023-08-24 19:22:59 +05:30 committed by tomf
parent 8be0176e7c
commit 9796cbb021
3 changed files with 52 additions and 0 deletions

View File

@ -65,6 +65,8 @@
- [hddfancontrol](https://github.com/desbma/hddfancontrol), a service to regulate fan speeds based on hard drive temperature. Available as [services.hddfancontrol](#opt-services.hddfancontrol.enable).
- [seatd](https://sr.ht/~kennylevinsen/seatd/), A minimal seat management daemon. Available as [services.seatd](#opt-services.seatd.enable).
- [GoToSocial](https://gotosocial.org/), an ActivityPub social network server, written in Golang. Available as [services.gotosocial](#opt-services.gotosocial.enable).
- [Castopod](https://castopod.org/), an open-source hosting platform made for podcasters who want to engage and interact with their audience. Available as [services.castopod](#opt-services.castopod.enable).

View File

@ -474,6 +474,7 @@
./services/desktops/pipewire/pipewire.nix
./services/desktops/pipewire/wireplumber.nix
./services/desktops/profile-sync-daemon.nix
./services/desktops/seatd.nix
./services/desktops/system-config-printer.nix
./services/desktops/system76-scheduler.nix
./services/desktops/telepathy.nix

View File

@ -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";
};
};
};
}