From afa497d9ead993ce8c728b43723a37c0313cf181 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 7 Jan 2022 16:59:17 -0500 Subject: [PATCH] peripherals/razer: add razer hardware module --- hosts/Infini-DESKTOP/default.nix | 2 ++ .../modules/hardware/peripherals/razer.nix | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 modules/modules/hardware/peripherals/razer.nix diff --git a/hosts/Infini-DESKTOP/default.nix b/hosts/Infini-DESKTOP/default.nix index 9ca9ca7..597c896 100644 --- a/hosts/Infini-DESKTOP/default.nix +++ b/hosts/Infini-DESKTOP/default.nix @@ -20,6 +20,8 @@ gpu.nvidia = true; wireless.enable = true; form.desktop = true; + + peripherals.razer.enable = true; }; services = { foldingathome = { diff --git a/modules/modules/hardware/peripherals/razer.nix b/modules/modules/hardware/peripherals/razer.nix new file mode 100644 index 0000000..27e18bf --- /dev/null +++ b/modules/modules/hardware/peripherals/razer.nix @@ -0,0 +1,21 @@ +# from https://github.com/hlissner/dotfiles/blob/master/modules/hardware/razer.nix +{ options, config, lib, pkgs, ... }: + +with lib; +with lib.hlissner; +let cfg = config.modules.hardware.peripherals.razer; +in +{ + options.modules.hardware.peripherals.razer = { + enable = mkBoolOpt false; + }; + + config = mkIf cfg.enable { + hardware.openrazer = { + enable = true; + users = [ config.user.name ]; + }; + + user.extraGroups = [ "plugdev" ]; + }; +}