nixpkgs/nixos/modules/services/hardware/tuxedo-rs.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.3 KiB
Nix
Raw Permalink Normal View History

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