2023-10-09 19:29:22 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.hardware.tuxedo-rs;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
hardware.tuxedo-rs = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkEnableOption "Rust utilities for interacting with hardware from TUXEDO Computers";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
tailor-gui.enable = lib.mkEnableOption "tailor-gui, an alternative to TUXEDO Control Center, written in Rust";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
2023-10-09 19:29:22 +00:00
|
|
|
{
|
|
|
|
hardware.tuxedo-keyboard.enable = true;
|
|
|
|
|
|
|
|
systemd = {
|
|
|
|
services.tailord = {
|
|
|
|
enable = true;
|
|
|
|
description = "Tuxedo Tailor hardware control service";
|
|
|
|
after = [ "systemd-logind.service" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "dbus";
|
|
|
|
BusName = "com.tux.Tailor";
|
|
|
|
ExecStart = "${pkgs.tuxedo-rs}/bin/tailord";
|
|
|
|
Environment = "RUST_BACKTRACE=1";
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.dbus.packages = [ pkgs.tuxedo-rs ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.tuxedo-rs ];
|
|
|
|
}
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mkIf cfg.tailor-gui.enable {
|
2023-10-09 19:29:22 +00:00
|
|
|
environment.systemPackages = [ pkgs.tailor-gui ];
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
meta.maintainers = with lib.maintainers; [ mrcjkb ];
|
2023-10-09 19:29:22 +00:00
|
|
|
}
|