From fc119fb3248d7c1f0ba484458fe89625346d5a09 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 29 Jan 2024 21:01:52 -0500 Subject: [PATCH] feat: add razer module for peripherals --- devices/binto/default.nix | 1 + modules/razer.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 modules/razer.nix diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 7dce410e..c9ca0425 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -10,6 +10,7 @@ in { ../../modules/kmscon.nix ../../modules/printer.nix ../../modules/proton-bridge.nix + ../../modules/razer.nix ../../modules/sshd.nix ../../modules/tailscale.nix diff --git a/modules/razer.nix b/modules/razer.nix new file mode 100644 index 00000000..a2cd5ab3 --- /dev/null +++ b/modules/razer.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (config.vars) mainUser; + inherit (lib) mkIf; + + cfgHypr = + config + .home-manager + .users + .${mainUser} + .wayland + .windowManager + .hyprland; +in { + hardware.openrazer = { + enable = true; + users = [mainUser]; + }; + + environment.systemPackages = with pkgs; [ + openrazer-daemon + polychromatic + ]; + + # HOME-MANAGER CONFIG + home-manager.users.${mainUser} = { + wayland.windowManager.hyprland = mkIf (cfgHypr.enable) { + settings.exec-once = ["polychromatic-tray-applet"]; + }; + }; +}