diff --git a/flake.nix b/flake.nix index cc107710..ad12fa61 100644 --- a/flake.nix +++ b/flake.nix @@ -134,6 +134,7 @@ joystick.enable = true; printer.enable = true; sound.enable = true; + legion.enable = true; }; packages.packageSet = "workstation"; virtualization = diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index c37dffaf..87137014 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -1,5 +1,6 @@ inputs: { + imports = inputs.localLib.mkModules [ ./legion.nix ]; options.nixos.hardware = let inherit (inputs.lib) mkOption types; in { bluetooth.enable = mkOption { type = types.bool; default = false; }; diff --git a/modules/hardware/legion.nix b/modules/hardware/legion.nix new file mode 100644 index 00000000..1e500e14 --- /dev/null +++ b/modules/hardware/legion.nix @@ -0,0 +1,16 @@ +inputs: +{ + options.nixos.hardware.legion = let inherit (inputs.lib) mkOption types; in + { + enable = mkOption { type = types.bool; default = false; }; + }; + config = + let + inherit (inputs.lib) mkIf; + inherit (inputs.config.nixos.hardware) legion; + in mkIf legion.enable + { + environment.systemPackages = [ inputs.pkgs.lenovo-legion ]; + boot.extraModulePackages = [ inputs.config.boot.kernelPackages.lenovo-legion-module ]; + }; +}