Skip to content

Commit

Permalink
nixos/tuxedo-rs: init at 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 23, 2023
1 parent f104617 commit 6d5b286
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@
./services/hardware/tlp.nix
./services/hardware/trezord.nix
./services/hardware/triggerhappy.nix
./services/hardware/tuxedo-rs.nix
./services/hardware/udev.nix
./services/hardware/udisks2.nix
./services/hardware/undervolt.nix
Expand Down
49 changes: 49 additions & 0 deletions nixos/modules/services/hardware/tuxedo-rs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.hardware.tuxedo-rs;

in
{
options = {
hardware.tuxedo-rs = {
enable = mkEnableOption (lib.mdDoc "Rust utilities for interacting with hardware from TUXEDO Computers.");

tailor_gui.enable = mkEnableOption (lib.mdDoc "Alternative to TUXEDO Control Center, written in Rust.");
};
};

config = mkIf cfg.enable (mkMerge [
{
hardware.tuxedo-keyboard.enable = true;

systemd = {
services.tailord = {
enable = true;
description = lib.literalMD "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 ];
}
(mkIf cfg.tailor_gui.enable {
environment.systemPackages = [ pkgs.tailor_gui ];
})
]);

meta.maintainers = with maintainers; [ mrcjkb ];
}

0 comments on commit 6d5b286

Please sign in to comment.