1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.hardware.tuxedo-rs;
7
8in
9{
10 options = {
11 hardware.tuxedo-rs = {
12 enable = mkEnableOption "Rust utilities for interacting with hardware from TUXEDO Computers";
13
14 tailor-gui.enable = mkEnableOption "tailor-gui, an alternative to TUXEDO Control Center, written in Rust";
15 };
16 };
17
18 config = mkIf cfg.enable (mkMerge [
19 {
20 hardware.tuxedo-keyboard.enable = true;
21
22 systemd = {
23 services.tailord = {
24 enable = true;
25 description = "Tuxedo Tailor hardware control service";
26 after = [ "systemd-logind.service" ];
27 wantedBy = [ "multi-user.target" ];
28
29 serviceConfig = {
30 Type = "dbus";
31 BusName = "com.tux.Tailor";
32 ExecStart = "${pkgs.tuxedo-rs}/bin/tailord";
33 Environment = "RUST_BACKTRACE=1";
34 Restart = "on-failure";
35 };
36 };
37 };
38
39 services.dbus.packages = [ pkgs.tuxedo-rs ];
40
41 environment.systemPackages = [ pkgs.tuxedo-rs ];
42 }
43 (mkIf cfg.tailor-gui.enable {
44 environment.systemPackages = [ pkgs.tailor-gui ];
45 })
46 ]);
47
48 meta.maintainers = with maintainers; [ mrcjkb ];
49}