summary refs log tree commit diff
path: root/nixos/modules/services/hardware
diff options
context:
space:
mode:
authorMarc Jakobi <marc.jakobi@tiko.energy>2023-09-26 23:27:22 +0200
committerMarc Jakobi <marc.jakobi@tiko.energy>2023-09-26 23:28:05 +0200
commit01cc0a605a03e0d6ad0b3482c964a67c3fdff01d (patch)
tree257d488e84804ebabdf34e260cc95e3ff46fe3fb /nixos/modules/services/hardware
parentc9e2bc6920c01684b3fd4a7724716ba730bfa903 (diff)
downloadnixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.tar
nixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.tar.gz
nixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.tar.bz2
nixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.tar.lz
nixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.tar.xz
nixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.tar.zst
nixpkgs-01cc0a605a03e0d6ad0b3482c964a67c3fdff01d.zip
nixos/tuxedo-rs: init at 0.2.2
Diffstat (limited to 'nixos/modules/services/hardware')
-rw-r--r--nixos/modules/services/hardware/tuxedo-rs.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixos/modules/services/hardware/tuxedo-rs.nix b/nixos/modules/services/hardware/tuxedo-rs.nix
new file mode 100644
index 00000000000..343f6845fab
--- /dev/null
+++ b/nixos/modules/services/hardware/tuxedo-rs.nix
@@ -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 = "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 ];
+}